linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/hns: Fix return in hns_roce_rereg_user_mr()
@ 2021-08-04 12:59 YueHaibing
  2021-08-04 13:53 ` Leon Romanovsky
  2021-08-19 14:18 ` Jason Gunthorpe
  0 siblings, 2 replies; 9+ messages in thread
From: YueHaibing @ 2021-08-04 12:59 UTC (permalink / raw)
  To: liangwenpeng, liweihang, dledford, jgg, chenglang
  Cc: linux-rdma, linux-kernel, YueHaibing

If re-registering an MR in hns_roce_rereg_user_mr(), we should
return NULL instead of pass 0 to ERR_PTR.

Fixes: 4e9fc1dae2a9 ("RDMA/hns: Optimize the MR registration process")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_mr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index 006c84bb3f9f..7089ac780291 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -352,7 +352,9 @@ struct ib_mr *hns_roce_rereg_user_mr(struct ib_mr *ibmr, int flags, u64 start,
 free_cmd_mbox:
 	hns_roce_free_cmd_mailbox(hr_dev, mailbox);
 
-	return ERR_PTR(ret);
+	if (ret)
+		return ERR_PTR(ret);
+	return NULL;
 }
 
 int hns_roce_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-19 14:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 12:59 [PATCH -next] RDMA/hns: Fix return in hns_roce_rereg_user_mr() YueHaibing
2021-08-04 13:53 ` Leon Romanovsky
2021-08-05  2:36   ` YueHaibing
2021-08-05  3:40     ` Leon Romanovsky
2021-08-05  9:29       ` YueHaibing
2021-08-05 10:58         ` Leon Romanovsky
2021-08-05 12:23           ` Jason Gunthorpe
2021-08-05 12:30             ` Leon Romanovsky
2021-08-19 14:18 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).