kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] NVMe: return an error code if blk_mq_alloc_tag_set() fails
@ 2015-01-19 14:43 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-01-19 14:43 UTC (permalink / raw)
  To: kernel-janitors

In the current code, if blk_mq_alloc_tag_set() fails then it returns
zero (success) instead of preserving the error code.  The caller is not
expecting that and the kernel could be left in an inconsistent state.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static analysis stuff.  Not tested.

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index cb529e9..2ff5efc 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2152,7 +2152,8 @@ static int nvme_dev_add(struct nvme_dev *dev)
 	dev->tagset.flags = BLK_MQ_F_SHOULD_MERGE;
 	dev->tagset.driver_data = dev;
 
-	if (blk_mq_alloc_tag_set(&dev->tagset))
+	res = blk_mq_alloc_tag_set(&dev->tagset);
+	if (res)
 		goto out;
 
 	id_ns = mem;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-19 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 14:43 [patch] NVMe: return an error code if blk_mq_alloc_tag_set() fails Dan Carpenter

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