]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/hns: Fix PD memory leak for internal allocation
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 20 May 2019 06:43:53 +0000 (09:43 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 21 May 2019 18:25:37 +0000 (15:25 -0300)
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>
drivers/infiniband/hw/hns/hns_roce_hw_v1.c

index 4c5d0f160c106f8974621bc0c459de2462e51300..e068a02122f5e3e5054d4b9b402500f8028c5e6e 100644 (file)
@@ -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)