diff options
author | Guoqing Jiang <guoqing.jiang@linux.dev> | 2022-11-17 13:19:40 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2022-11-17 14:47:28 +0300 |
commit | 102d2f70ec0999a5cde181f1ccbe8a81cba45b10 (patch) | |
tree | 36b3545d71b2d41c46261ca17a12141311b50105 /drivers/infiniband/ulp | |
parent | 0f597ac618d04beb9de997fda59a29c9d3818fb2 (diff) | |
download | linux-102d2f70ec0999a5cde181f1ccbe8a81cba45b10.tar.xz |
RDMA/rtrs-srv: Correct the checking of ib_map_mr_sg
We should check with nr_sgt, also the only successful case is that
all sg elements are mapped, so make it explicitly.
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20221117101945.6317-4-guoqing.jiang@linux.dev
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index b877dd57b6b9..581c850e71d6 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -622,7 +622,7 @@ static int map_cont_bufs(struct rtrs_srv_path *srv_path) } nr = ib_map_mr_sg(mr, sgt->sgl, nr_sgt, NULL, max_chunk_size); - if (nr < 0 || nr < sgt->nents) { + if (nr != nr_sgt) { err = nr < 0 ? nr : -EINVAL; goto dereg_mr; } |