diff options
author | 2009-10-27 11:38:24 +0000 | |
---|---|---|
committer | 2009-10-27 11:38:24 +0000 | |
commit | 5ddbf46dd15ccdf7a37c61ab105ce7fc98e2cb87 (patch) | |
tree | b8c9d39e1b8c3b8df20ae4bfedcf6986024006f8 | |
parent | welcome mpii(4). (diff) | |
download | wireguard-openbsd-5ddbf46dd15ccdf7a37c61ab105ce7fc98e2cb87.tar.xz wireguard-openbsd-5ddbf46dd15ccdf7a37c61ab105ce7fc98e2cb87.zip |
if (!ISSET(flags, SCSI_NOSLEEP)) return; else sleep(); is wrong.
found with krw while looking at #6247. tested locally with iogen and
scsi(8). this fixes a null deref in the ioctl path where there shouldnt be
one.
ok krw@
-rw-r--r-- | sys/scsi/scsi_base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 76a247a2e62..fcaaffd144e 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.136 2009/09/14 00:03:28 dlg Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.137 2009/10/27 11:38:24 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -189,7 +189,7 @@ scsi_xs_get(struct scsi_link *link, int flags) mtx_enter(&link->mtx); while (link->openings == 0) { - if (!ISSET(flags, SCSI_NOSLEEP)) { + if (ISSET(flags, SCSI_NOSLEEP)) { mtx_leave(&link->mtx); return (NULL); } |