Skip to content

Commit

Permalink
OMAP: PM: SmartReflex: Fix possible memory leak
Browse files Browse the repository at this point in the history
sr_info was allocated and needs a kfree before returning.

This error was reported by cppcheck:
arch/arm/mach-omap2/smartreflex.c:837: error: Memory leak: sr_info

To: Tony Lindgren <tony@atomide.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Shweta Gulati <shweta.gulati@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
  • Loading branch information
Stefan Weil authored and Kevin Hilman committed Jan 31, 2011
1 parent 6227011 commit 720bc78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/smartreflex.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)

if (!pdata) {
dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
return -EINVAL;
ret = -EINVAL;
goto err_free_devinfo;
}

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down

0 comments on commit 720bc78

Please sign in to comment.