linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guo Chao <yan@linux.vnet.ibm.com>
To: JBottomley@parallels.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 1/3] scsi: sd: set valid return value in init_sd()
Date: Fri, 23 Nov 2012 11:06:45 +0800	[thread overview]
Message-ID: <1353640007-12834-1-git-send-email-yan@linux.vnet.ibm.com> (raw)

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


             reply	other threads:[~2012-11-23  3:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23  3:06 Guo Chao [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353640007-12834-1-git-send-email-yan@linux.vnet.ibm.com \
    --to=yan@linux.vnet.ibm.com \
    --cc=JBottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).