linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NVMe: Free cmdid of nvme_submit_bio error
@ 2012-08-02 20:05 Keith Busch
  2012-11-06 16:32 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2012-08-02 20:05 UTC (permalink / raw)


Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 3278fbd..15670ca 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -545,6 +545,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
 	u16 control;
 	u32 dsmgmt;
 	int psegs = bio_phys_segments(ns->queue, bio);
+	nvme_completion_fn fn;
 
 	if ((bio->bi_rw & REQ_FLUSH) && psegs) {
 		result = nvme_submit_flush_data(nvmeq, ns);
@@ -588,7 +589,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
 
 	result = nvme_map_bio(nvmeq->q_dmadev, iod, bio, dma_dir, psegs);
 	if (result < 0)
-		goto free_iod;
+		goto free_cmdid;
 	length = result;
 
 	cmnd->rw.command_id = cmdid;
@@ -608,6 +609,8 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
 
 	return 0;
 
+ free_cmdid:
+	free_cmdid(nvmeq, cmdid, &fn);
  free_iod:
 	nvme_free_iod(nvmeq->dev, iod);
  nomem:
-- 
1.7.0.4

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

* [PATCH] NVMe: Free cmdid of nvme_submit_bio error
  2012-08-02 20:05 [PATCH] NVMe: Free cmdid of nvme_submit_bio error Keith Busch
@ 2012-11-06 16:32 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2012-11-06 16:32 UTC (permalink / raw)



Fixed it slightly differently (changed free_cmdid() to allow for fn to
be NULL).  But I kept your attribution and added an explanation.

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

end of thread, other threads:[~2012-11-06 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 20:05 [PATCH] NVMe: Free cmdid of nvme_submit_bio error Keith Busch
2012-11-06 16:32 ` Matthew Wilcox

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