diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-06-17 11:59:42 (GMT) |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-07-15 22:11:03 (GMT) |
commit | 41ec66c92299889ad30871aeede89b960f08a458 (patch) | |
tree | 740a9c7d063a3570ca909821079449d1ba6627ae /drivers/gpio | |
parent | 1c8b5d688d7ef401c209f3fc84b7de8296f8908a (diff) | |
download | linux-41ec66c92299889ad30871aeede89b960f08a458.tar.xz |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-altera.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 675d15d..9b7e0b3 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -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; } |