Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755853AbdCTWvc (ORCPT ); Mon, 20 Mar 2017 18:51:32 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:36551 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754523AbdCTWva (ORCPT ); Mon, 20 Mar 2017 18:51:30 -0400 From: Brian Norris To: Bjorn Helgaas Cc: , Shawn Lin , Jeffy Chen , Wenrui Li , linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, Brian Norris Subject: [PATCH] PCI: rockchip: don't leak the PCI resource list Date: Mon, 20 Mar 2017 15:49:36 -0700 Message-Id: <20170320224936.28605-1-briannorris@chromium.org> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 926 Lines: 26 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 --- 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