* [PATCH 2.6.38] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove
@ 2010-11-03 9:24 Jarkko Nikula
2010-11-16 21:31 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Nikula @ 2010-11-03 9:24 UTC (permalink / raw)
To: linux-omap; +Cc: Tony Lindgren, Jarkko Nikula
Function omap_mcbsp_probe allocates struct omap_mcbsp *mcbsp but it is not
freed in omap_mcbsp_remove. Fix this, remove unneeded structure cleanups
and clk_disable calls since they are not needed here.
This is not problem currently but becomes if the mcbsp driver is ever
modularized.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
arch/arm/plat-omap/mcbsp.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b97..f79090c 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -1836,17 +1836,11 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
omap34xx_device_exit(mcbsp);
- clk_disable(mcbsp->fclk);
- clk_disable(mcbsp->iclk);
clk_put(mcbsp->fclk);
clk_put(mcbsp->iclk);
iounmap(mcbsp->io_base);
-
- mcbsp->fclk = NULL;
- mcbsp->iclk = NULL;
- mcbsp->free = 0;
- mcbsp->dev = NULL;
+ kfree(mcbsp);
}
return 0;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.38] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove
2010-11-03 9:24 [PATCH 2.6.38] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove Jarkko Nikula
@ 2010-11-16 21:31 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2010-11-16 21:31 UTC (permalink / raw)
To: Jarkko Nikula; +Cc: linux-omap
* Jarkko Nikula <jhnikula@gmail.com> [101103 02:15]:
> Function omap_mcbsp_probe allocates struct omap_mcbsp *mcbsp but it is not
> freed in omap_mcbsp_remove. Fix this, remove unneeded structure cleanups
> and clk_disable calls since they are not needed here.
>
> This is not problem currently but becomes if the mcbsp driver is ever
> modularized.
Queuing this for 2.6.38 merge window.
Tony
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-16 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-03 9:24 [PATCH 2.6.38] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove Jarkko Nikula
2010-11-16 21:31 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).