[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160209113543.GL27969@c203.arch.suse.de>
Date: Tue, 9 Feb 2016 12:35:43 +0100
From: Johannes Thumshirn <jthumshirn@...e.de>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, linux-raid@...r.kernel.org,
kernel-janitors@...r.kernel.org, dm-devel@...hat.com,
Shaohua Li <shli@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [dm-devel] [patch] dm: check for kmalloc failure in
dm_init_request_based_blk_mq_queue()
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@...cle.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@...hat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
Good catch,
Reviewed-by: Johannes Thumshirn <jthumshirn@...e.de>
--
Johannes Thumshirn Storage
jthumshirn@...e.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
Powered by blists - more mailing lists