From: kn Date: Sat, 4 May 2024 16:40:38 +0000 (+0000) Subject: dma_free(9) just once in error case X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=450e503cc7a06ae925ab19b9c1da4b330e0d8c19;p=openbsd 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 --- 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.