From: Uwe Kleine-König Date: Fri, 18 Feb 2011 20:59:25 +0000 (+0100) Subject: ARM: mxc: free dma_mask in error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c762b293d4a12fb726cec62cfe3e64f66cf3103f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ARM: mxc: free dma_mask in error path This fixes a small memory leak that was only hit in very unlikely error paths Signed-off-by: Uwe Kleine-König --- diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c index e9bcefe79a43..eee1b6096a08 100644 --- a/arch/arm/plat-mxc/devices.c +++ b/arch/arm/plat-mxc/devices.c @@ -81,6 +81,8 @@ struct platform_device *__init imx_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); }