Re: [PATCH -next] nvme-rdma: fix the return value of nvme_rdma_reinit_request()

From: J Freyensee
Date: Tue Jul 12 2016 - 10:19:27 EST


On Tue, 2016-07-12 at 11:06 +0000, weiyj_lk@xxxxxxx wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> PTR_ERR should be applied before its argument is reassigned,
> otherwise the
> return value will be set to 0, not error code.

Another good catch.

Reviewed-by: Jay Freyensee <james_p_freyensee@xxxxxxxxxxxxxxx>

>
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

> if (IS_ERR(req->mr)) {
> - req->mr = NULL;
> ret = PTR_ERR(req->mr);
> + req->mr = NULL;
> }