OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9907526
)
RDMA/hns: fix memory leak in hns_roce_alloc_mr()
author
Zhengchao Shao
<shaozhengchao@huawei.com>
Sat, 19 Nov 2022 07:08:34 +0000
(15:08 +0800)
committer
Leon Romanovsky
<leon@kernel.org>
Tue, 22 Nov 2022 14:20:08 +0000
(16:20 +0200)
When hns_roce_mr_enable() failed in hns_roce_alloc_mr(), mr_key is not
released. Compiled test only.
Fixes:
9b2cf76c9f05
("RDMA/hns: Optimize PBL buffer allocation process")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link:
https://lore.kernel.org/r/20221119070834.48502-1-shaozhengchao@huawei.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_mr.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/hns/hns_roce_mr.c
b/drivers/infiniband/hw/hns/hns_roce_mr.c
index
845ac7d
..
37a5cf6
100644
(file)
--- a/
drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/
drivers/infiniband/hw/hns/hns_roce_mr.c
@@
-392,10
+392,10
@@
struct ib_mr *hns_roce_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
return &mr->ibmr;
-err_key:
- free_mr_key(hr_dev, mr);
err_pbl:
free_mr_pbl(hr_dev, mr);
+err_key:
+ free_mr_key(hr_dev, mr);
err_free:
kfree(mr);
return ERR_PTR(ret);