diff options
author | Md Haris Iqbal <haris.iqbal@ionos.com> | 2023-11-20 16:41:41 +0100 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-11-22 12:40:55 +0100 |
commit | 3a71cd6ca0ce33d1af019ecf1d7167406fa54400 (patch) | |
tree | ad94211940a1122cb5ff99bd412723826016ac8d | |
parent | RDMA/rtrs-srv: Check return values while processing info request (diff) | |
download | linux-3a71cd6ca0ce33d1af019ecf1d7167406fa54400.tar.xz linux-3a71cd6ca0ce33d1af019ecf1d7167406fa54400.zip |
RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true
Since srv_mr->iu is allocated and used only when always_invalidate is
true, free it only when always_invalidate is true.
Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality")
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@ionos.com>
Link: https://lore.kernel.org/r/20231120154146.920486-5-haris.iqbal@ionos.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-srv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index 4be0e5b132d4..925b71481c62 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -551,7 +551,10 @@ static void unmap_cont_bufs(struct rtrs_srv_path *srv_path) struct rtrs_srv_mr *srv_mr; srv_mr = &srv_path->mrs[i]; - rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1); + + if (always_invalidate) + rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1); + ib_dereg_mr(srv_mr->mr); ib_dma_unmap_sg(srv_path->s.dev->ib_dev, srv_mr->sgt.sgl, srv_mr->sgt.nents, DMA_BIDIRECTIONAL); |