summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-11-10 10:34:08 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-11-10 10:34:08 +0000
commit5c53e3c2129296ab7dede4b6e2b699b1b795fe42 (patch)
treee9c5917caf856426b017a2dbb6e34863007e1ee8
parent83ad88e29d246c92b9cd98f8938cf987775f1fc6 (diff)
dont compare devids when we dont have a devid to compare with.
DEVID_CMP now evaluates to false if the devids are NULL. some stupid devices dont understand luns, so we have code that detects when the device at lun 0 also appears at luns 1, 2, 3, and so on. this check is short circuited if the devices report different devids. no devids isnt the same as different devids though. found by okan@ on ciss (which currently ignores luns). tested by krw@ marco@ johan@ okan@ ok krw@ marco@
-rw-r--r--sys/scsi/scsiconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index b7af1a4213a..f801a1d5d53 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.149 2009/11/10 10:13:08 dlg Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.150 2009/11/10 10:34:07 dlg Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -927,7 +927,8 @@ scsi_probedev(struct scsibus_softc *scsi, int target, int lun)
;
else if (sc_link->flags & SDEV_UMASS)
;
- else if (!DEVID_CMP(scsi->sc_link[target][0]->id, sc_link->id))
+ else if (sc_link->id != NULL &&
+ !DEVID_CMP(scsi->sc_link[target][0]->id, sc_link->id))
;
else if (memcmp(inqbuf, &scsi->sc_link[target][0]->inqdata,
sizeof(*inqbuf)) == 0) {