* [PATCH] PCI: Free released resource
@ 2023-09-06 11:08 Ross Lagerwall
2023-09-06 20:04 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Ross Lagerwall @ 2023-09-06 11:08 UTC (permalink / raw)
To: linux-pci; +Cc: Bjorn Helgaas, Ross Lagerwall, Kalle Valo, stable
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 <ross.lagerwall@citrix.com>
Reported-by: Kalle Valo <kvalo@kernel.org>
Closes: https://lore.kernel.org/r/878r9sga1t.fsf@kernel.org/
Tested-by: Kalle Valo <kvalo@kernel.org>
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;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] PCI: Free released resource
2023-09-06 11:08 [PATCH] PCI: Free released resource Ross Lagerwall
@ 2023-09-06 20:04 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2023-09-06 20:04 UTC (permalink / raw)
To: Ross Lagerwall; +Cc: linux-pci, Bjorn Helgaas, Kalle Valo, stable
On Wed, Sep 06, 2023 at 12:08:46PM +0100, Ross Lagerwall wrote:
> 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 <ross.lagerwall@citrix.com>
> Reported-by: Kalle Valo <kvalo@kernel.org>
> Closes: https://lore.kernel.org/r/878r9sga1t.fsf@kernel.org/
> Tested-by: Kalle Valo <kvalo@kernel.org>
> Cc: stable@vger.kernel.org # v5.16+
Applied to for-linus for v6.6-rc1.
> ---
> 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;
> }
>
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-06 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 11:08 [PATCH] PCI: Free released resource Ross Lagerwall
2023-09-06 20:04 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).