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 <yamada.masahiro@socionext.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Tien Hock Loh <thloh@altera.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Masahiro Yamada 2015-06-17 20:59:42 +09:00 committed by Linus Walleij
parent 1c8b5d688d
commit 41ec66c922
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}