Commit 458a9632 authored by Wei Yongjun's avatar Wei Yongjun Committed by Jens Axboe

nvme-rdma: fix the return value of nvme_rdma_reinit_request()

PTR_ERR should be applied before its argument is reassigned, otherwise the
return value will be set to 0, not error code.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: default avatarJay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent bf294e83
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment