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 6769E11706 for ; Mon, 11 Sep 2023 14:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9A15C433C8; Mon, 11 Sep 2023 14:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694444293; bh=zIYJgjZXsuLOZrMqaPOWNdN0I3VQraAgdkPptOfqtoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aop09Qwr/BkC7q2EQF5n/0HcNd+OW74ujysyyerwbVKXl/Bz9vt+oT+NlsePO58AM 7CxbegZd71HfPZusry2Z/E3V9DsT5xAf8G4QfXANoxKIkmEj9P48TjhbgZqGzdQPkz 9qdYV1rQBIVxGAhgHJ9QtpOqO3mnJfCT/3Zjxy8s= 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.4 679/737] PCI: Free released resource after coalescing Date: Mon, 11 Sep 2023 15:48:58 +0200 Message-ID: <20230911134709.505511094@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.286315610@linuxfoundation.org> References: <20230911134650.286315610@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.4-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 @@ -999,6 +999,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; }