Compaq PCI Hotplug driver bugfix
PATCH 1/1 Compaq PCI Hotplug driver bugfix
Hi,
Here's a patch against 2.5.3-pre1 for the Compaq PCI Hotplug driver that fixes two memory leaks in the driver (one if registering a slot fails, and the other when the driver is unloaded from the kernel.)
thanks,
greg k-h
drivers/hotplug/cpqphp_core.c +6 -0
@@ -404,6 +404,10 @@ result =pci_hp_register (new_slot->hotplug_slot);if (result) {err ("pci_hp_register failed with error %d\n" , result); +kfree (new_slot->hotplug_slot->info); +kfree (new_slot->hotplug_slot->name); +kfree (new_slot->hotplug_slot); +kfree (new_slot);return result; }
@@ -429,6 +433,8 @@while (old_slot) { next_slot = old_slot->next;pci_hp_deregister (old_slot->hotplug_slot); +kfree (old_slot->hotplug_slot->info); +kfree (old_slot->hotplug_slot->name);kfree (old_slot->hotplug_slot);kfree (old_slot); old_slot = next_slot;