提交 458a9632 编写于 作者: W Wei Yongjun 提交者: 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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: NJay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册