]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/hns: fix memory leak in hns_roce_alloc_mr()
authorZhengchao Shao <shaozhengchao@huawei.com>
Sat, 19 Nov 2022 07:08:34 +0000 (15:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:33 +0000 (13:32 +0100)
commit302449f72885c3b823fe4c2677ce244360392409
treef8fbcf749a5f2e55ba03b6ed3af3aa15350b1471
parentafc98bf6ef81b0288fe55db0b9e0ea7cd2f012e1
RDMA/hns: fix memory leak in hns_roce_alloc_mr()

[ Upstream commit 7d3d9a93707216b9a437b98b30a94f0863b99686 ]

When hns_roce_mr_enable() failed in hns_roce_alloc_mr(), mr_key is not
released. Compiled test only.

Fixes: 4b11f6ea54ef ("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>
drivers/infiniband/hw/hns/hns_roce_mr.c