From: Masahiro Yamada Date: Wed, 17 Jun 2015 11:59:42 +0000 (+0900) Subject: gpio: altera: use of_mm_gpiochip_remove() to fix memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41ec66c92299889ad30871aeede89b960f08a458;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git gpio: altera: use of_mm_gpiochip_remove() to fix memory leak This driver calls of_mm_gpiochip_add() to add a memory mapped gpio chip. So, of_mm_gpiochip_remove() should be used when removing it. The direct call of gpiochip_remove() misses unmapping the register and freeing the label. Signed-off-by: Masahiro Yamada Reviewed-by: Alexandre Courbot Acked-by: Tien Hock Loh Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 675d15d6e9be..9b7e0b3db387 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -338,7 +338,7 @@ static int altera_gpio_remove(struct platform_device *pdev) { struct altera_gpio_chip *altera_gc = platform_get_drvdata(pdev); - gpiochip_remove(&altera_gc->mmchip.gc); + of_mm_gpiochip_remove(&altera_gc->mmchip); return 0; }