From 84082d665dc62e632e21213fda8b22c0b8c25b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= Date: Wed, 15 Dec 2010 22:11:31 +0100 Subject: [PATCH] ARM: mxs: free dma_mask in error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- arch/arm/mach-mxs/devices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c index c20d54740b0b..cfdb6b284702 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); } -- GitLab