]> Git Repo - linux.git/commitdiff
nvme-rdma: Check that reinit_request got a proper mr
authorSagi Grimberg <[email protected]>
Wed, 11 Oct 2017 12:29:09 +0000 (15:29 +0300)
committerChristoph Hellwig <[email protected]>
Wed, 18 Oct 2017 17:27:52 +0000 (19:27 +0200)
Warn if req->mr is NULL as it should never happen.

Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
drivers/nvme/host/rdma.c

index 221ace23aaa5e2386375f8ec8d18d71d975af34a..7e61e6447d2cc45b6f76d09c57360585895f5089 100644 (file)
@@ -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,
This page took 0.05704 seconds and 4 git commands to generate.