From patchwork Wed Sep 6 11:08:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 13375529 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A0DDEB8FB7 for ; Wed, 6 Sep 2023 11:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbjIFLI7 (ORCPT ); Wed, 6 Sep 2023 07:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjIFLI6 (ORCPT ); Wed, 6 Sep 2023 07:08:58 -0400 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2AD8CF1; Wed, 6 Sep 2023 04:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1693998531; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EjoL1liNmMORk3s/gwWZ5XM6fEQ6JOyB1f/12zKspDI=; b=U75GZguwXHzSWQrxzKPmyPplEjopfpKxCUhu+vwOnG4jGx7z9om2HfqJ Ufc3CVGbHjQ8jvmmomqfbTOsMBZhXYuDPjHfgqCRvP9XuP3h1fIFJn+sg DsZpS0b5Z3/n1CrBijvGoVL95wJkvkx16GB04Q9o+2o+5ob3H0t+RI1hg M=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 124515739 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-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JoYe1dbAvmgh4RsstoXzk5A /4AbpDXmn2zocX1YzXN8J57ELz5BSFTOHwCkOQOLrTrClM/SAkc5wr5netJl3pNw/4EyY8lP xiVBidl9bYIrSGddF/TOy84OdsCn/9X9BoGAMDlBn7ws1BLXGplxP53m0cfFVX/yNFe8A== IronPort-HdrOrdr: A9a23:qt3OuqzEJPG5QmFUVHuVKrPwIL1zdoMgy1knxilNoRw8SKKlfq eV7ZAmPH7P+VAssR4b+exoVJPtfZq+z+8R3WByB8bAYOCOggLBR+sO0WKL+UyGJ8SUzI9gPM lbHJSWcOeAb2RHsQ== X-Talos-CUID: 9a23:wPGEoWM1vftNZe5DSnJt8UQJF+4fanDsxirXMWriJ2h3cejA X-Talos-MUID: 9a23:s0SKQgT95U3iOQ8KRXTGtD4hH99W556eEQcQlIdZm8C6DCh/bmI= X-IronPort-AV: E=Sophos;i="6.02,231,1688443200"; d="scan'208";a="124515739" From: Ross Lagerwall To: CC: Bjorn Helgaas , Ross Lagerwall , Kalle Valo , Subject: [PATCH] PCI: Free released resource Date: Wed, 6 Sep 2023 12:08:46 +0100 Message-ID: <20230906110846.225369-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org release_resource() doesn't actually free the resource or resource list entry so free the resource list entry to avoid a leak. Fixes: e54223275ba1 ("PCI: Release resource invalidated by coalescing") Signed-off-by: Ross Lagerwall Reported-by: Kalle Valo Closes: https://lore.kernel.org/r/878r9sga1t.fsf@kernel.org/ Tested-by: Kalle Valo Cc: stable@vger.kernel.org # v5.16+ --- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ab2a4a3a4c06..795534589b98 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -997,6 +997,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) res = window->res; if (!res->flags && !res->start && !res->end) { release_resource(res); + resource_list_destroy_entry(window); continue; }