* [PATCH 1/2] media: video/tuner-core, fix memory leak
@ 2010-01-06 16:47 Jiri Slaby
2010-01-06 16:47 ` [PATCH 2/2] PCI: hotplug, fix memory leaks Jiri Slaby
2010-01-06 16:53 ` [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
0 siblings, 2 replies; 4+ messages in thread
From: Jiri Slaby @ 2010-01-06 16:47 UTC (permalink / raw)
To: jbarnes; +Cc: linux-kernel, jirislaby, Mauro Carvalho Chehab, linux-media
Stanse found a memory leak in tuner_probe. t is not
freed/assigned on all paths. Fix that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
---
drivers/media/video/tuner-core.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 5b3eaa1..c4dab6c 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1078,6 +1078,7 @@ static int tuner_probe(struct i2c_client *client,
goto register_client;
}
+ kfree(t);
return -ENODEV;
case 0x42:
case 0x43:
--
1.6.5.7
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] PCI: hotplug, fix memory leaks
2010-01-06 16:47 [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
@ 2010-01-06 16:47 ` Jiri Slaby
2010-01-06 23:54 ` Kenji Kaneshige
2010-01-06 16:53 ` [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
1 sibling, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2010-01-06 16:47 UTC (permalink / raw)
To: jbarnes; +Cc: linux-kernel, jirislaby, linux-pci
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@suse.cz>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: linux-pci@vger.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);
--
1.6.5.7
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] PCI: hotplug, fix memory leaks
2010-01-06 16:47 ` [PATCH 2/2] PCI: hotplug, fix memory leaks Jiri Slaby
@ 2010-01-06 23:54 ` Kenji Kaneshige
0 siblings, 0 replies; 4+ messages in thread
From: Kenji Kaneshige @ 2010-01-06 23:54 UTC (permalink / raw)
To: Jiri Slaby; +Cc: jbarnes, linux-kernel, jirislaby, linux-pci
Good catch.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.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@suse.cz>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: linux-pci@vger.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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] media: video/tuner-core, fix memory leak
2010-01-06 16:47 [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
2010-01-06 16:47 ` [PATCH 2/2] PCI: hotplug, fix memory leaks Jiri Slaby
@ 2010-01-06 16:53 ` Jiri Slaby
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2010-01-06 16:53 UTC (permalink / raw)
To: Jiri Slaby; +Cc: jbarnes, linux-kernel, Mauro Carvalho Chehab, linux-media
On 01/06/2010 05:47 PM, Jiri Slaby wrote:
> Stanse found a memory leak in tuner_probe. t is not
> freed/assigned on all paths. Fix that.
Oops. I generated two patches here, only the second is for PCI.
Sorry Mauro, you got this one twice.
--
js
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-06 23:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-06 16:47 [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
2010-01-06 16:47 ` [PATCH 2/2] PCI: hotplug, fix memory leaks Jiri Slaby
2010-01-06 23:54 ` Kenji Kaneshige
2010-01-06 16:53 ` [PATCH 1/2] media: video/tuner-core, fix memory leak Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome