summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2017-10-11 15:29:09 +0300
committerChristoph Hellwig <hch@lst.de>2017-10-18 19:27:52 +0200
commit0fc176dfdafc78e66bd74f54e487ca1fc59d01bf (patch)
treee240db5cc55c47c3d2c7c48865a9a02a672cb41f /drivers/nvme
parent0c5b43b9c1fafc5af37915dde6670aaf1224e8cc (diff)
downloadtalos-obmc-linux-0fc176dfdafc78e66bd74f54e487ca1fc59d01bf.tar.gz
talos-obmc-linux-0fc176dfdafc78e66bd74f54e487ca1fc59d01bf.zip
nvme-rdma: Check that reinit_request got a proper mr
Warn if req->mr is NULL as it should never happen. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/rdma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 221ace23aaa5..7e61e6447d2c 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -274,6 +274,9 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq)
struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
int ret = 0;
+ if (WARN_ON_ONCE(!req->mr))
+ return 0;
+
ib_dereg_mr(req->mr);
req->mr = ib_alloc_mr(dev->pd, IB_MR_TYPE_MEM_REG,
OpenPOWER on IntegriCloud