summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan <gnomes@lxorguk.ukuu.org.uk>2013-12-03 17:11:04 +0100
committerJames Bottomley <JBottomley@Parallels.com>2013-12-20 05:56:28 +0100
commit603f202e9eb083671f35f07cfe6be3e062c7ee31 (patch)
tree06ee6fdf4e1ad63f745375349531cf94c695edd5
parent[SCSI] st: fix enlarge_buffer (diff)
downloadlinux-603f202e9eb083671f35f07cfe6be3e062c7ee31.tar.xz
linux-603f202e9eb083671f35f07cfe6be3e062c7ee31.zip
[SCSI] mac_scsi: Fix crash on out of memory
Missing check on scsi_register Signed-off-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/mac_scsi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 858075723c87..f5cdc68cd5b6 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -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;