Skip to content

Commit

Permalink
gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masahiro Yamada authored and Linus Walleij committed Jul 15, 2015
1 parent 1c8b5d6 commit 41ec66c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-altera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 41ec66c

Please sign in to comment.