]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[SCSI] mac_scsi: Fix crash on out of memory
authorAlan <gnomes@lxorguk.ukuu.org.uk>
Tue, 3 Dec 2013 16:11:04 +0000 (16:11 +0000)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 17 Dec 2013 20:41:46 +0000 (12:41 -0800)
Missing check on scsi_register

Signed-off-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mac_scsi.c

index 858075723c87fc2e010f582385126529ac168fff..f5cdc68cd5b6f194f9f1f5e573e1c7747a70bb48 100644 (file)
@@ -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;