Prev: [PATCH] staging/lirc: fix non-CONFIG_MODULES build horkage
Next: [PATCH] char: ip2: check put_user() result
From: Kulikov Vasiliy on 29 Jul 2010 12:00 scsi_register() may fail, if so return from detect() with negative result. Signed-off-by: Kulikov Vasiliy <segooon(a)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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |