[PATCH 1/3] scsi: sd: set valid return value in init_sd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



init_sd() forgets to set error code when we fail to create slab
cache, thus return 0 in a failed path. Return ENOMEM in this case.

Signed-off-by: Guo Chao <yan@xxxxxxxxxxxxxxxxxx>
---
 drivers/scsi/sd.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 352bc77..4cc277d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3120,6 +3120,7 @@ static int __init init_sd(void)
 	if (err)
 		goto err_out_class;
 
+	err = -ENOMEM;
 	sd_cdb_cache = kmem_cache_create("sd_ext_cdb", SD_EXT_CDB_SIZE,
 					 0, 0, NULL);
 	if (!sd_cdb_cache) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux