From 603f202e9eb083671f35f07cfe6be3e062c7ee31 Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 3 Dec 2013 16:11:04 +0000 Subject: [SCSI] mac_scsi: Fix crash on out of memory Missing check on scsi_register Signed-off-by: Alan Cox Signed-off-by: James Bottomley --- drivers/scsi/mac_scsi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 8580757..f5cdc68 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; -- cgit v1.1