linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] scsi: sd: set valid return value in init_sd()
@ 2012-11-23  3:06 Guo Chao
  2012-11-23  3:06 ` [PATCH 2/3] scsi: sd: no need to set gendisk->minors in sd_probe_async() Guo Chao
  2012-11-23  3:06 ` [PATCH 3/3] scsi: sd: remove unnecessary initialization in sd_probe() Guo Chao
  0 siblings, 2 replies; 3+ messages in thread
From: Guo Chao @ 2012-11-23  3:06 UTC (permalink / raw)
  To: JBottomley; +Cc: linux-scsi

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@linux.vnet.ibm.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-23  3:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23  3:06 [PATCH 1/3] scsi: sd: set valid return value in init_sd() Guo Chao
2012-11-23  3:06 ` [PATCH 2/3] scsi: sd: no need to set gendisk->minors in sd_probe_async() Guo Chao
2012-11-23  3:06 ` [PATCH 3/3] scsi: sd: remove unnecessary initialization in sd_probe() Guo Chao

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