lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
From
Date
Acked-by: Tien Hock Loh <thloh@altera.com>

On Wed, 2015-06-17 at 20:59 +0900, Masahiro Yamada wrote:
> 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>
> ---
>
> drivers/gpio/gpio-altera.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index 449fb46..c653c83 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -337,7 +337,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 -EIO;
> }



\
 
 \ /
  Last update: 2015-06-26 06:01    [W:0.084 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site