Skip to content

Commit

Permalink
omap: McBSP: Fix potential memory leak in omap_mcbsp_remove
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Jarkko Nikula authored and Tony Lindgren committed Dec 8, 2010
1 parent b1cc4c5 commit 5f3b728
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/arm/plat-omap/mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f3b728

Please sign in to comment.