Skip to contentSkip to conversation

scsi: mac_scsi: check scsi_register() result

PATCH New Kulikov Vasiliy 1 participant 1 message Jul 29, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: mac_scsi: check scsi_register() result

scsi_register() may fail, if so return from detect() with negative result.

---
 drivers/scsi/mac_scsi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/scsi/mac_scsi.c +3 -0
index bf2a1c5..3ab601f 100644
@@ -268,6 +268,9 @@ int macscsi_detect(struct scsi_host_template * tpnt)
     /* Once we support multiple 5380s (e.g. DuoDock) we'll do
        something different here */
     instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
+    if (instance = NULL)
+	return 0;
+
 #if NDEBUG
     default_instance = instance;
 #endif
Signature · 1 line
1.7.0.4