linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: mac_scsi: check scsi_register() result
@ 2010-07-29 15:56 Kulikov Vasiliy
  0 siblings, 0 replies; only message in thread
From: Kulikov Vasiliy @ 2010-07-29 15:56 UTC (permalink / raw)
  To: kernel-janitors; +Cc: James E.J. Bottomley, linux-scsi, linux-kernel

scsi_register() may fail, if so return from detect() with negative
result.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/scsi/mac_scsi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index bf2a1c5..3ab601f 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -268,6 +268,9 @@ int 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 NDEBUG
     default_instance = instance;
 #endif
-- 
1.7.0.4

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

only message in thread, other threads:[~2010-07-29 15:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 15:56 [PATCH] scsi: mac_scsi: check scsi_register() result Kulikov Vasiliy

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).