public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	linux-raid@vger.kernel.org, kernel-janitors@vger.kernel.org,
	dm-devel@redhat.com, Shaohua Li <shli@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [dm-devel] [patch] dm: check for kmalloc failure in dm_init_request_based_blk_mq_queue()
Date: Tue, 9 Feb 2016 12:35:43 +0100	[thread overview]
Message-ID: <20160209113543.GL27969@c203.arch.suse.de> (raw)
In-Reply-To: <20160209111440.GB23998@mwanda>

On Tue, Feb 09, 2016 at 02:14:40PM +0300, Dan Carpenter wrote:
> We can just return -ENOMEM if the kzalloc() fails.
> 
> Fixes: 41b2facaf4ba ('dm: allocate blk_mq_tag_set rather than embed in mapped_device')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 6b7e80e..1a5f879 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -2736,6 +2736,8 @@ static int dm_init_request_based_blk_mq_queue(struct mapped_device *md,
>  	int err;
>  
>  	md->tag_set = kzalloc(sizeof(struct blk_mq_tag_set), GFP_KERNEL);
> +	if (!md->tag_set)
> +		return -ENOMEM;
>  	md->tag_set->ops = &dm_mq_ops;
>  	md->tag_set->queue_depth = dm_get_blk_mq_queue_depth();
>  	md->tag_set->numa_node = NUMA_NO_NODE;
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

Good catch,

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2016-02-09 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 11:14 [patch] dm: check for kmalloc failure in dm_init_request_based_blk_mq_queue() Dan Carpenter
2016-02-09 11:35 ` Johannes Thumshirn [this message]
2016-02-09 15:08 ` Mike Snitzer

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=20160209113543.GL27969@c203.arch.suse.de \
    --to=jthumshirn@suse.de \
    --cc=agk@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dm-devel@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@kernel.org \
    --cc=snitzer@redhat.com \
    /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