Commit dc2d7266 authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

[PATCH] PCI Hotplug: memory leaks in acpiphp_glue

Here's the memory leaks patch for acpiphp_glue.c.
parent 13f77785
...@@ -578,6 +578,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -578,6 +578,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1); bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1);
if (!bridge->io_head) { if (!bridge->io_head) {
err("out of memory\n"); err("out of memory\n");
kfree(bridge);
return; return;
} }
dbg("16bit I/O range: %04x-%04x\n", dbg("16bit I/O range: %04x-%04x\n",
...@@ -592,6 +593,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -592,6 +593,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1); bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1);
if (!bridge->io_head) { if (!bridge->io_head) {
err("out of memory\n"); err("out of memory\n");
kfree(bridge);
return; return;
} }
dbg("32bit I/O range: %08x-%08x\n", dbg("32bit I/O range: %08x-%08x\n",
...@@ -613,6 +615,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -613,6 +615,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
bridge->mem_head = acpiphp_make_resource((u64)base, limit - base + 1); bridge->mem_head = acpiphp_make_resource((u64)base, limit - base + 1);
if (!bridge->mem_head) { if (!bridge->mem_head) {
err("out of memory\n"); err("out of memory\n");
kfree(bridge);
return; return;
} }
dbg("32bit Memory range: %08x-%08x\n", dbg("32bit Memory range: %08x-%08x\n",
...@@ -632,6 +635,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -632,6 +635,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
bridge->p_mem_head = acpiphp_make_resource((u64)base, limit - base + 1); bridge->p_mem_head = acpiphp_make_resource((u64)base, limit - base + 1);
if (!bridge->p_mem_head) { if (!bridge->p_mem_head) {
err("out of memory\n"); err("out of memory\n");
kfree(bridge);
return; return;
} }
dbg("32bit Prefetchable memory range: %08x-%08x\n", dbg("32bit Prefetchable memory range: %08x-%08x\n",
...@@ -647,6 +651,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -647,6 +651,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
bridge->p_mem_head = acpiphp_make_resource(base64, limit64 - base64 + 1); bridge->p_mem_head = acpiphp_make_resource(base64, limit64 - base64 + 1);
if (!bridge->p_mem_head) { if (!bridge->p_mem_head) {
err("out of memory\n"); err("out of memory\n");
kfree(bridge);
return; return;
} }
dbg("64bit Prefetchable memory range: %08x%08x-%08x%08x\n", dbg("64bit Prefetchable memory range: %08x%08x-%08x%08x\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment