From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C2BD11710 for ; Mon, 11 Sep 2023 15:26:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA61C433C8; Mon, 11 Sep 2023 15:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694446010; bh=BlOc4KhmNRV9DhpC91WHSxCtgRwNbzic7mUGECHXxtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQCEgjtqUqPfeLyUMfxO32D/0Uzy16uAPKhicDwGCx+Z40WJW6K3S0TCcVyPn1sfx Ox7WntuO9IrYZiGQ+WAYgMoAqPYjwwgAXd90FWKkscl890FtpcyQOdzLjZaOFSs4yK e+PNPbSkcKczx4kvsIfcayzpboeLwf/ZWA6unnjk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kalle Valo , Ross Lagerwall , Bjorn Helgaas Subject: [PATCH 6.1 551/600] PCI: Free released resource after coalescing Date: Mon, 11 Sep 2023 15:49:44 +0200 Message-ID: <20230911134649.882097130@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134633.619970489@linuxfoundation.org> References: <20230911134633.619970489@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ross Lagerwall commit 8ec9c1d5d0a5a4744516adb483b97a238892f9d5 upstream. release_resource() doesn't actually free the resource or resource list entry so free the resource list entry to avoid a leak. Closes: https://lore.kernel.org/r/878r9sga1t.fsf@kernel.org/ Fixes: e54223275ba1 ("PCI: Release resource invalidated by coalescing") Link: https://lore.kernel.org/r/20230906110846.225369-1-ross.lagerwall@citrix.com Reported-by: Kalle Valo Tested-by: Kalle Valo Signed-off-by: Ross Lagerwall Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.16+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -996,6 +996,7 @@ static int pci_register_host_bridge(stru res = window->res; if (!res->flags && !res->start && !res->end) { release_resource(res); + resource_list_destroy_entry(window); continue; }