linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
@ 2015-06-17 11:59 Masahiro Yamada
  2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Masahiro Yamada @ 2015-06-17 11:59 UTC (permalink / raw)
  To: linux-gpio
  Cc: Masahiro Yamada, Linus Walleij, Alexandre Courbot, linux-kernel,
	Tien Hock Loh

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;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-15  9:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
2015-06-21  7:25   ` Alexandre Courbot
2015-06-22  1:36     ` Tien Hock Loh
2015-06-22  2:25       ` Alexandre Courbot
2015-06-22 10:04       ` Masahiro Yamada
2015-06-26  3:16   ` Tien Hock Loh
2015-06-21  7:22 ` [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Alexandre Courbot
2015-06-26  3:17 ` Tien Hock Loh
2015-07-15  9:45 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).