linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: Fix crash on out of memory with MAC SCSI
@ 2013-12-03 16:11 Alan
  0 siblings, 0 replies; only message in thread
From: Alan @ 2013-12-03 16:11 UTC (permalink / raw)
  To: jbottomley, linux-scsi

From: Alan <gnomes@lxorguk.ukuu.org.uk>

Missing check on scsi_register

Signed-off-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
---
 drivers/scsi/mac_scsi.c |    2 ++
 1 file changed, 2 insertions(+)

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;


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-03 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03 16:11 [PATCH] scsi: Fix crash on out of memory with MAC SCSI Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).