linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch] nvme-rdma: fix an error code
@ 2016-07-13 10:03 Dan Carpenter
  2016-07-13 16:23 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-07-13 10:03 UTC (permalink / raw)


We accidentally return success when an error code was intended.

Fixes: 711023071960 ('nvme-rdma: add a NVMe over Fabrics RDMA host driver')
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 278551b..5208f16 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -299,8 +299,8 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq)
 	req->mr = ib_alloc_mr(dev->pd, IB_MR_TYPE_MEM_REG,
 			ctrl->max_fr_pages);
 	if (IS_ERR(req->mr)) {
-		req->mr = NULL;
 		ret = PTR_ERR(req->mr);
+		req->mr = NULL;
 	}
 
 	req->need_inval = false;

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

end of thread, other threads:[~2016-07-13 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13 10:03 [patch] nvme-rdma: fix an error code Dan Carpenter
2016-07-13 16:23 ` Jens Axboe
2016-07-13 19:33   ` 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).