Commit 348c3422 authored by Wei Yongjun's avatar Wei Yongjun Committed by Tony Lindgren

ARM: OMAP1: DMA: fix error handling in omap1_system_dma_init()

Add the missing iounmap() before return from omap1_system_dma_init()
in the error handling case.
Also removed platform_device_del() on add resources error case which
cause dup device delete.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent e7e17c53
...@@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void) ...@@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void)
if (ret) { if (ret) {
dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n", dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
__func__, pdev->name, pdev->id); __func__, pdev->name, pdev->id);
goto exit_device_put; goto exit_iounmap;
} }
p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL); p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
...@@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void) ...@@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void)
dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n", dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
__func__, pdev->name); __func__, pdev->name);
ret = -ENOMEM; ret = -ENOMEM;
goto exit_device_del; goto exit_iounmap;
} }
d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
...@@ -402,8 +402,8 @@ static int __init omap1_system_dma_init(void) ...@@ -402,8 +402,8 @@ static int __init omap1_system_dma_init(void)
kfree(d); kfree(d);
exit_release_p: exit_release_p:
kfree(p); kfree(p);
exit_device_del: exit_iounmap:
platform_device_del(pdev); iounmap(dma_base);
exit_device_put: exit_device_put:
platform_device_put(pdev); platform_device_put(pdev);
......
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