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

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
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment