aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2019-05-20 09:43:53 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-05-21 15:25:37 -0300
commit619122be3d40c835eb5fad9e326780909926495d (patch)
tree736bb617053a779e81ad5652a4d806799a5eae03 /drivers/infiniband
parentRDMA/srp: Rename SRP sysfs name after IB device rename trigger (diff)
downloadlinux-dev-619122be3d40c835eb5fad9e326780909926495d.tar.xz
linux-dev-619122be3d40c835eb5fad9e326780909926495d.zip
RDMA/hns: Fix PD memory leak for internal allocation
free_pd is allocated internally by the driver hence needs to be freed internally too or it leaks. Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core") Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 4c5d0f160c10..e068a02122f5 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -899,6 +899,7 @@ static void hns_roce_v1_release_lp_qp(struct hns_roce_dev *hr_dev)
dev_err(dev, "Destroy cq for mr_free failed(%d)!\n", ret);
hns_roce_dealloc_pd(&free_mr->mr_free_pd->ibpd, NULL);
+ kfree(&free_mr->mr_free_pd->ibpd);
}
static int hns_roce_db_init(struct hns_roce_dev *hr_dev)