PCI: rpaphp: Fix a memleak; slot->location string was never freed
Fix a memleak; the slot->location string was never freed. Fix some whitespace and overlong-line probelms while we're here. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: John Rose <johnrose@austin.ibm.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
31be7586d1
commit
5fd39c35a0
@@ -56,7 +56,6 @@ static struct hotplug_slot_attribute php_attr_location = {
|
|||||||
static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
|
static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
|
||||||
{
|
{
|
||||||
struct slot *slot = (struct slot *) hotplug_slot->private;
|
struct slot *slot = (struct slot *) hotplug_slot->private;
|
||||||
|
|
||||||
dealloc_slot_struct(slot);
|
dealloc_slot_struct(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,12 +64,12 @@ void dealloc_slot_struct(struct slot *slot)
|
|||||||
kfree(slot->hotplug_slot->info);
|
kfree(slot->hotplug_slot->info);
|
||||||
kfree(slot->hotplug_slot->name);
|
kfree(slot->hotplug_slot->name);
|
||||||
kfree(slot->hotplug_slot);
|
kfree(slot->hotplug_slot);
|
||||||
|
kfree(slot->location);
|
||||||
kfree(slot);
|
kfree(slot);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name,
|
struct slot *alloc_slot_struct(struct device_node *dn,
|
||||||
int power_domain)
|
int drc_index, char *drc_name, int power_domain)
|
||||||
{
|
{
|
||||||
struct slot *slot;
|
struct slot *slot;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user