From 450e503cc7a06ae925ab19b9c1da4b330e0d8c19 Mon Sep 17 00:00:00 2001 From: kn Date: Sat, 4 May 2024 16:40:38 +0000 Subject: [PATCH] dma_free(9) just once in error case buf is free'd and NULL, don't do it again to avoid a panic. OK krw --- sys/scsi/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 92d2f5e10b0..fe1aa9fc7a7 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.335 2023/11/10 17:43:39 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.336 2024/05/04 16:40:38 kn Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -1771,7 +1771,7 @@ validate: } if (dp.disksize == 0) - goto die; + return -1; /* * Restrict secsize values to powers of two between 512 and 64k. -- 2.20.1