2020-10-29 08:46:37

by Qinglang Miao

[permalink] [raw]
Subject: [PATCH] mips: ar7: add missing iounmap() on error in ar7_gpio_init

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]>
---
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 8b006addd..ae0e01b94 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.23.0


2020-11-06 10:57:40

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH] mips: ar7: add missing iounmap() on error in ar7_gpio_init

On Wed, Oct 28, 2020 at 05:15:45PM +0800, Qinglang Miao wrote:
> 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]>
> ---
> arch/mips/ar7/gpio.c | 1 +
> 1 file changed, 1 insertion(+)

applied to mips-next.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]