]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.15/rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch
Linux 5.0.15
[thirdparty/kernel/stable-queue.git] / releases / 5.0.15 / rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch
CommitLineData
64fefc3e
SL
1From bafb26da5b36455233f65e692289bc6c034a78d2 Mon Sep 17 00:00:00 2001
2From: Kamal Heib <kamalheib1@gmail.com>
3Date: Wed, 3 Apr 2019 16:52:54 +0300
4Subject: RDMA/vmw_pvrdma: Fix memory leak on pvrdma_pci_remove
5
6[ Upstream commit ea7a5c706fa49273cf6d1d9def053ecb50db2076 ]
7
8Make sure to free the DSR on pvrdma_pci_remove() to avoid the memory leak.
9
10Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
11Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
12Acked-by: Adit Ranadive <aditr@vmware.com>
13Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
14Signed-off-by: Sasha Levin <sashal@kernel.org>
15---
16 drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
20index 39c37b6fd7159..76b8dda40eddd 100644
21--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
22+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
23@@ -1125,6 +1125,8 @@ static void pvrdma_pci_remove(struct pci_dev *pdev)
24 pvrdma_page_dir_cleanup(dev, &dev->cq_pdir);
25 pvrdma_page_dir_cleanup(dev, &dev->async_pdir);
26 pvrdma_free_slots(dev);
27+ dma_free_coherent(&pdev->dev, sizeof(*dev->dsr), dev->dsr,
28+ dev->dsrbase);
29
30 iounmap(dev->regs);
31 kfree(dev->sgid_tbl);
32--
332.20.1
34