From: Ewan Milne <emilne@redhat.com>
To: "Clément Calmels" <clement.calmels@free.fr>
Cc: JBottomley@parallels.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sd: bad return code of init_sd
Date: Wed, 04 Jun 2014 12:44:11 -0400 [thread overview]
Message-ID: <1401900251.26039.47.camel@localhost.localdomain> (raw)
In-Reply-To: <1401831265-8547-1-git-send-email-clement.calmels@free.fr>
On Tue, 2014-06-03 at 23:34 +0200, Clément Calmels wrote:
> In init_sd function, if kmem_cache_create or mempool_create_slab_pools
> calls fail, the error will not be correclty reported because
> class_register previously set the value of err to 0.
>
> Signed-off-by: Clément Calmels <clement.calmels@free.fr>
> ---
> drivers/scsi/sd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index e9689d5..7daa2aa 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -3205,12 +3205,14 @@ static int __init init_sd(void)
> 0, 0, NULL);
> if (!sd_cdb_cache) {
> printk(KERN_ERR "sd: can't init extended cdb cache\n");
> + err = -ENOMEM;
> goto err_out_class;
> }
>
> sd_cdb_pool = mempool_create_slab_pool(SD_MEMPOOL_SIZE, sd_cdb_cache);
> if (!sd_cdb_pool) {
> printk(KERN_ERR "sd: can't init extended cdb pool\n");
> + err = -ENOMEM;
> goto err_out_cache;
> }
>
I posted this same patch on 2/14/2013. Thanks for reminding me!
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-04 16:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 21:34 [PATCH] sd: bad return code of init_sd Clément Calmels
2014-06-04 16:44 ` Ewan Milne [this message]
2014-06-11 12:10 ` Christoph Hellwig
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=1401900251.26039.47.camel@localhost.localdomain \
--to=emilne@redhat.com \
--cc=JBottomley@parallels.com \
--cc=clement.calmels@free.fr \
--cc=linux-kernel@vger.kernel.org \
--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