dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [patch] dm: check for kmalloc failure in dm_init_request_based_blk_mq_queue()
@ 2016-02-09 11:14 Dan Carpenter
  2016-02-09 11:35 ` [dm-devel] " Johannes Thumshirn
  2016-02-09 15:08 ` Mike Snitzer
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-02-09 11:14 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer
  Cc: dm-devel, Shaohua Li, linux-raid, linux-kernel, kernel-janitors

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;

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

end of thread, other threads:[~2016-02-09 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [dm-devel] " Johannes Thumshirn
2016-02-09 15:08 ` Mike Snitzer

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