Skip to contentSkip to conversation

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

PATCH New Wei Yongjun 2 participants 2 messages Apr 26, 2013 – May 8, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP1: DMA: fix error handling in omap1_system_dma_init()

From: Wei Yongjun <[email protected]>

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.

---
no compile test.

---
 arch/arm/mach-omap1/dma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap1/dma.c +4 -4
index 1a4e887..68ab858 100644
@@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void)
 	if (ret) {
 		dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
 			__func__, pdev->name, pdev->id);
-		goto exit_device_put;
+		goto exit_iounmap;
 	}
 
 	p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
@@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void)
 		dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
 			__func__, pdev->name);
 		ret = -ENOMEM;
-		goto exit_device_del;
+		goto exit_iounmap;
 	}
 
 	d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
@@ -402,8 +402,8 @@ exit_release_d:
 	kfree(d);
 exit_release_p:
 	kfree(p);
-exit_device_del:
-	platform_device_del(pdev);
+exit_iounmap:
+	iounmap(dma_base);
 exit_device_put:
 	platform_device_put(pdev);
 
reviewer
#1 lore raw

PATCH 1/1 ARM: OMAP1: DMA: fix error handling in omap1_system_dma_init()

Quoted 10 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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.

---
no compile test.

Seems to work, applying into omap-for-v3.10/fixes thanks.

Tony

Quoted 37 lines
 arch/arm/mach-omap1/dma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap1/dma.c +4 -4
index 1a4e887..68ab858 100644
@@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void)
 	if (ret) {
 		dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
 			__func__, pdev->name, pdev->id);
-		goto exit_device_put;
+		goto exit_iounmap;
 	}
 
 	p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
@@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void)
 		dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
 			__func__, pdev->name);
 		ret = -ENOMEM;
-		goto exit_device_del;
+		goto exit_iounmap;
 	}
 
 	d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
@@ -402,8 +402,8 @@ exit_release_d:
 	kfree(d);
 exit_release_p:
 	kfree(p);
-exit_device_del:
-	platform_device_del(pdev);
+exit_iounmap:
+	iounmap(dma_base);
 exit_device_put:
 	platform_device_put(pdev);