Commit c762b293 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Sascha Hauer

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 84082d66
...@@ -81,6 +81,8 @@ struct platform_device *__init imx_add_platform_device_dmamask( ...@@ -81,6 +81,8 @@ struct platform_device *__init imx_add_platform_device_dmamask(
ret = platform_device_add(pdev); ret = platform_device_add(pdev);
if (ret) { if (ret) {
err: err:
if (dmamask)
kfree(pdev->dev.dma_mask);
platform_device_put(pdev); platform_device_put(pdev);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment