Skip to contentSkip to conversation

mfd: asic3: Add missing iounmap() on error asic3_mfd_probe

PATCH Applied Miaoqian Lin 2 participants 2 messages Mar 7, 2022 – Mar 21, 2022 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: asic3: Add missing iounmap() on error asic3_mfd_probe

Add the missing iounmap() before return from asic3_mfd_probe in the error handling case.

Fixes 64e8867ba809 ("mfd: tmio_mmc hardware abstraction for CNF area")
---
 drivers/mfd/asic3.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/mfd/asic3.c +7 -3
index 8d58c8df46cf..56338f9dbd0b 100644
@@ -906,14 +906,14 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 		ret = mfd_add_devices(&pdev->dev, pdev->id,
 			&asic3_cell_ds1wm, 1, mem, asic->irq_base, NULL);
 		if (ret < 0)
-			goto out;
+			goto out_unmap;
 	}
 
 	if (mem_sdio && (irq >= 0)) {
 		ret = mfd_add_devices(&pdev->dev, pdev->id,
 			&asic3_cell_mmc, 1, mem_sdio, irq, NULL);
 		if (ret < 0)
-			goto out;
+			goto out_unmap;
 	}
 
 	ret = 0;
@@ -927,8 +927,12 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 		ret = mfd_add_devices(&pdev->dev, 0,
 			asic3_cell_leds, ASIC3_NUM_LEDS, NULL, 0, NULL);
 	}
+	return ret;
 
- out:
+out_unmap:
+	if (asic->tmio_cnf)
+		iounmap(asic->tmio_cnf);
+out:
 	return ret;
 }
 
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 8 lines · Miaoqian Lin

Add the missing iounmap() before return from asic3_mfd_probe in the error handling case.

Fixes 64e8867ba809 ("mfd: tmio_mmc hardware abstraction for CNF area")
---
 drivers/mfd/asic3.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog