[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1434542383-21314-1-git-send-email-yamada.masahiro@socionext.com>
Date: Wed, 17 Jun 2015 20:59:42 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-gpio@...r.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
linux-kernel@...r.kernel.org, Tien Hock Loh <thloh@...era.com>
Subject: [PATCH 1/2] 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@...ionext.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;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists