lkml.org 
[lkml]   [2002]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Compaq PCI Hotplug driver bugfix
Hi,

Here's a patch against 2.4.18-pre4 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


diff -Nru a/drivers/hotplug/cpqphp_core.c b/drivers/hotplug/cpqphp_core.c
--- a/drivers/hotplug/cpqphp_core.c Wed Jan 16 12:10:57 2002
+++ b/drivers/hotplug/cpqphp_core.c Wed Jan 16 12:10:57 2002
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:23    [W:0.035 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site