diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-01-18 19:54:50 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-01-18 19:54:50 +0000 |
commit | f5e562192a0c6aab3bff6416c2f719c985267f0a (patch) | |
tree | 6db07332f96175f10a6a592a1782f68c9b28a00b /sys | |
parent | 73b6d7e8f520ce80f63fc2a60305419613bdd9c9 (diff) |
Don't index before the start of the sc_link array if scsi_probe_bus()
is called with a target of -1 and a valid lun. Spotted by Miod.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsiconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index f53c7d92b28..9d2750dd769 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.98 2005/11/13 03:27:42 krw Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.99 2006/01/18 19:54:49 krw Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -290,7 +290,7 @@ scsi_probe_bus(bus, target, lun) if (lun < 0 || lun >= scsi->adapter_link->luns) return EINVAL; maxlun = lun; - if (lun == 0 || scsi->sc_link[target][0] == NULL) + if (target == -1 || scsi->sc_link[target][0] == NULL) minlun = 0; else minlun = lun; |