gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 17 Jun 2015 11:59:42 +0000 (20:59 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 15 Jul 2015 22:11:03 +0000 (00:11 +0200)
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>
drivers/gpio/gpio-altera.c

index 675d15d6e9be77cc90e8530d4ac6381cca900f1e..9b7e0b3db387218865004332c8313616026d7ae4 100644 (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;
 }