mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI: rockchip: don't leak the PCI resource list
@ 2017-03-20 22:49 Brian Norris
  2017-03-21  1:25 ` Shawn Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2017-03-20 22:49 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, Shawn Lin, Jeffy Chen, Wenrui Li, linux-pci,
	linux-rockchip, Brian Norris

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-21  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 22:49 [PATCH] PCI: rockchip: don't leak the PCI resource list Brian Norris
2017-03-21  1:25 ` Shawn Lin
2017-03-21  2:21   ` Brian Norris
2017-03-21  3:55     ` jeffy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome