Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41ec66c9 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarTien Hock Loh <thloh@altera.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1c8b5d68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}