Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605190

[PATCH] PCI: rockchip: don't leak the PCI resource list

From Brian Norris <briannorris@chromium.org>
Newsgroups linux.kernel
Subject [PATCH] PCI: rockchip: don't leak the PCI resource list
Date 2017-03-21 00:00 +0100
Message-ID <tnero-2XH-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This list is local to the probe() function. We should free it up in both
the success case and the error case, but currently we're only freeing it
in the error case (see commit f1d722b607d6 ("PCI: rockchip: Fix
rockchip_pcie_probe() error path to free resource list")).

Caught by kmemleak, when doing repeated bind/unbind tests.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/pci/host/pcie-rockchip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index bd6df7254de4..8087a0698d65 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -1396,6 +1396,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
 		goto err_free_res;
 	}
 	rockchip->root_bus = bus;
+	pci_free_resource_list(&res);
 
 	pci_bus_size_bridges(bus);
 	pci_bus_assign_resources(bus);
-- 
2.12.0.367.g23dc2f6d3c-goog

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] PCI: rockchip: don't leak the PCI resource list Brian Norris <briannorris@chromium.org> - 2017-03-21 00:00 +0100
  Re: [PATCH] PCI: rockchip: don't leak the PCI resource list Shawn Lin <shawn.lin@rock-chips.com> - 2017-03-21 02:30 +0100
    Re: [PATCH] PCI: rockchip: don't leak the PCI resource list Brian Norris <briannorris@chromium.org> - 2017-03-21 03:30 +0100
      Re: [PATCH] PCI: rockchip: don't leak the PCI resource list jeffy <jeffy.chen@rock-chips.com> - 2017-03-21 05:00 +0100

csiph-web