diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-01-06 11:47:56 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-22 19:16:57 -0500 |
commit | 6fcaf17ac7a512227112ac81c0e1a5862bab57a6 (patch) | |
tree | a238d8a279f7fbc742b606b58b421ea2ea297403 /drivers | |
parent | 3b7a17fcdae532d29dffab9d564a28be08960988 (diff) |
PCI hotplug: fix memory leaks
Stanse found a cut&pasted memory leak in pciehp_queue_pushbutton_work
and shpchp_queue_pushbutton_work. info is not freed/assigned on all
paths. Fix that.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 1 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index d6ac1b261dd9..9a7f247e8ac1 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -341,6 +341,7 @@ void pciehp_queue_pushbutton_work(struct work_struct *work) | |||
341 | p_slot->state = POWERON_STATE; | 341 | p_slot->state = POWERON_STATE; |
342 | break; | 342 | break; |
343 | default: | 343 | default: |
344 | kfree(info); | ||
344 | goto out; | 345 | goto out; |
345 | } | 346 | } |
346 | queue_work(pciehp_wq, &info->work); | 347 | queue_work(pciehp_wq, &info->work); |
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 179b1c1cb99b..3bba0c0888ff 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -453,6 +453,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) | |||
453 | p_slot->state = POWERON_STATE; | 453 | p_slot->state = POWERON_STATE; |
454 | break; | 454 | break; |
455 | default: | 455 | default: |
456 | kfree(info); | ||
456 | goto out; | 457 | goto out; |
457 | } | 458 | } |
458 | queue_work(shpchp_wq, &info->work); | 459 | queue_work(shpchp_wq, &info->work); |