ARM: mxc: free dma_mask in error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 18 Feb 2011 20:59:25 +0000 (21:59 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 1 Mar 2011 13:19:56 +0000 (14:19 +0100)
This fixes a small memory leak that was only hit in very unlikely error
paths

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
arch/arm/plat-mxc/devices.c

index e9bcefe79a43d6edb1a18e8ade4b8b3f6bb83619..eee1b6096a0898ce869238cd5b421bca50a6e411 100644 (file)
@@ -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);
        }