Skip to contentSkip to conversation

scsi: Fix crash on out of memory with MAC SCSI

PATCH RESEND New Alan 1 participant 1 message Dec 17, 2013

Subsystems (2)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH RESEND 1/1 scsi: Fix crash on out of memory with MAC SCSI

From: Alan <alan@[email protected]>

Missing check on scsi_register

---
 drivers/scsi/mac_scsi.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/mac_scsi.c +2 -0
index 8580757..f5cdc68 100644
@@ -260,6 +260,8 @@ int __init 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 (macintosh_config->ident == MAC_MODEL_IIFX) {
 	mac_scsi_regp  = via1+0x8000;