diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-07-12 13:06:17 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-12 17:27:03 +0200 |
commit | 458a9632ad7428e16e1feafb61aca33a11ac2f46 (patch) | |
tree | 485fa0491663dbcf92bb76d354547b9ab509da40 /drivers/nvme | |
parent | cdrom: support read sub-channel command in LBA format (diff) | |
download | linux-458a9632ad7428e16e1feafb61aca33a11ac2f46.tar.xz linux-458a9632ad7428e16e1feafb61aca33a11ac2f46.zip |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/rdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 278551bcd5c7..5208f16a6815 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; |