From: Lothar Waßmann Date: Wed, 15 Dec 2010 21:11:31 +0000 (+0100) Subject: ARM: mxs: free dma_mask in error path X-Git-Tag: v2.6.39-rc1~434^2~5^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84082d665dc62e632e21213fda8b22c0b8c25b81;p=platform%2Fupstream%2Fkernel-adaptation-pc.git ARM: mxs: free dma_mask in error path This fixes a small memory leak that was only hit in very unlikely error paths. Signed-off-by: Lothar Waßmann Signed-off-by: Uwe Kleine-König --- diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c index c20d547..cfdb6b2 100644 --- a/arch/arm/mach-mxs/devices.c +++ b/arch/arm/mach-mxs/devices.c @@ -66,6 +66,8 @@ struct platform_device *__init mxs_add_platform_device_dmamask( ret = platform_device_add(pdev); if (ret) { err: + if (dmamask) + kfree(pdev->dev.dma_mask); platform_device_put(pdev); return ERR_PTR(ret); }