Skip to contentSkip to conversation

PCI: Free released resource

PATCH Applied Ross Lagerwall 2 participants 2 messages Sep 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: Free released resource

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")
Cc [email protected] # v5.16+
---
 drivers/pci/probe.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/probe.c +1 -0
index ab2a4a3a4c06..795534589b98 100644
@@ -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;
 		}
 
Signature · 1 line
2.41.0
#1 lore raw
Quoted 9 lines · Ross Lagerwall

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")
Cc [email protected] # v5.16+

Applied to for-linus for v6.6-rc1.

Quoted 19 lines
---
 drivers/pci/probe.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/probe.c +1 -0
index ab2a4a3a4c06..795534589b98 100644
@@ -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;
 		}
 
Signature · 1 line
2.41.0