RDMA/hns: Fix memory leak in free_mr_init()
authorChengchang Tang <tangchengchang@huawei.com>
Thu, 7 Dec 2023 11:42:31 +0000 (19:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:34 +0000 (15:35 -0800)
commite785018a7f06bf6e141235b7473e3b9f4793426a
tree664d86b9de33264e83fc13c1a8e611c0dba6b9d0
parent1e2c9e7418246da377b47cc5b6a217dd2eaf5de3
RDMA/hns: Fix memory leak in free_mr_init()

[ Upstream commit 288f535951aa81ed674f5e5477ab11b9d9351b8c ]

When a reserved QP fails to be created, the memory of the remaining
created reserved QPs is leaked.

Fixes: 70f92521584f ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231207114231.2872104-6-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c