aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2011-01-30 20:26:27 +0100
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-02-07 12:15:17 -0500
commit2d2d43410181f46760ec9f7b5deb179dd4c5e16e (patch)
tree77f173a90cfacc4560e9b08a80fcd17599ebdd1d
parent012e3f16f8b9d63128821e377def472369b4b280 (diff)
downloadlinux-linaro-2d2d43410181f46760ec9f7b5deb179dd4c5e16e.tar.gz
OMAP: PM: SmartReflex: Fix possible memory leak
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> (cherry picked from commit 720bc782249015a30438516cee5c4be180a3f675)
-rw-r--r--arch/arm/mach-omap2/smartreflex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index d7deadfaddb..5f429b96fc9 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -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);