mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
RDMA/hns: fix memory leak in hns_roce_alloc_mr()
[ Upstream commita115aa00b1] When hns_roce_mr_enable() failed in hns_roce_alloc_mr(), mr_key is not released. Compiled test only. Fixes:9b2cf76c9f("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0657db7287
commit
fd32e378bc
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user