From: Qinglang Miao <[email protected]>

[ Upstream commit 5a5aa912f687204d50455d0db36f94dd8de601c2 ]

Add the missing iounmap() of gpch->regs before return from
ar7_gpio_init() in the error handling case.

Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
 arch/mips/ar7/gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index 8b006addd6ba5..ae0e01b9438ff 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -319,6 +319,7 @@ int __init ar7_gpio_init(void)
        if (ret) {
                printk(KERN_ERR "%s: failed to add gpiochip\n",
                                        gpch->chip.label);
+               iounmap(gpch->regs);
                return ret;
        }
        printk(KERN_INFO "%s: registered %d GPIOs\n",
-- 
2.27.0

Reply via email to