ARM: mxs: free dma_mask in error path
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 15 Dec 2010 21:11:31 +0000 (22:11 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 1 Mar 2011 13:19:55 +0000 (14:19 +0100)
This fixes a small memory leak that was only hit in very unlikely error
paths.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
arch/arm/mach-mxs/devices.c

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