diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-10-27 11:38:25 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-10-27 11:38:25 +0000 |
commit | 048bfb2904b0ee9eb60d34291604873e5f5de8e8 (patch) | |
tree | a41abdca54c5b3f7255a6cd0c1d1df3b6011d72b /sys | |
parent | 42518f2d585eb097a4d0510c4208de77d7a80e1c (diff) |
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@
Diffstat (limited to 'sys')
-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); } |