Browse Source

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 <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Lothar Waßmann 14 years ago
parent
commit
84082d665d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      arch/arm/mach-mxs/devices.c

+ 2 - 0
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);
 	}