projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f597ac
)
RDMA/rtrs-srv: Correct the checking of ib_map_mr_sg
author
Guoqing Jiang
<guoqing.jiang@linux.dev>
Thu, 17 Nov 2022 10:19:40 +0000
(18:19 +0800)
committer
Leon Romanovsky
<leon@kernel.org>
Thu, 17 Nov 2022 11:47:28 +0000
(13:47 +0200)
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>
drivers/infiniband/ulp/rtrs/rtrs-srv.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
index
b877dd5
..
581c850
100644
(file)
--- 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;
}