[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4B4522BE.7050902@jp.fujitsu.com>
Date: Thu, 07 Jan 2010 08:54:38 +0900
From: Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>
To: Jiri Slaby <jslaby@...e.cz>
CC: jbarnes@...tuousgeek.org, linux-kernel@...r.kernel.org,
jirislaby@...il.com, linux-pci@...r.kernel.org
Subject: Re: [PATCH 2/2] PCI: hotplug, fix memory leaks
Good catch.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>
Jiri Slaby wrote:
> 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.
>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: Jesse Barnes <jbarnes@...tuousgeek.org>
> Cc: linux-pci@...r.kernel.org
> ---
> drivers/pci/hotplug/pciehp_ctrl.c | 1 +
> 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 d6ac1b2..9a7f247 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)
> p_slot->state = POWERON_STATE;
> break;
> default:
> + kfree(info);
> goto out;
> }
> queue_work(pciehp_wq, &info->work);
> diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
> index b8ab279..86f6276 100644
> --- a/drivers/pci/hotplug/shpchp_ctrl.c
> +++ b/drivers/pci/hotplug/shpchp_ctrl.c
> @@ -462,6 +462,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work)
> p_slot->state = POWERON_STATE;
> break;
> default:
> + kfree(info);
> goto out;
> }
> queue_work(shpchp_wq, &info->work);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists