OMAP: PM: SmartReflex: Fix possible memory leak
authorStefan Weil <weil@mail.berlios.de>
Sun, 30 Jan 2011 19:26:27 +0000 (20:26 +0100)
committerKevin Hilman <khilman@ti.com>
Mon, 31 Jan 2011 20:59:15 +0000 (12:59 -0800)
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>
arch/arm/mach-omap2/smartreflex.c

index d7deadfaddbcd37ff107436cb959975a7ba94570..5f429b96fc9333a6083d64c78172b1aa1930cc4b 100644 (file)
@@ -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);