All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH gpio] gpio: removing kfree remove functionality
@ 2015-04-07 16:04 Varka Bhadram
  2015-04-08 14:54 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Varka Bhadram @ 2015-04-07 16:04 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, johan, gnurou

commit 3de07e5aaf290a0b58919 ("drivers: gpio: use devm_kzalloc")
introduce devm_kzalloc() for allocating the memory. In this case kfree
is not required to use. Above commit id introduced the bug that kfree
is not removed from the remove function.

This patch fix the above bug.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/gpio/gpio-adp5588.c  |    1 -
 drivers/gpio/gpio-mcp23s08.c |    2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index c90273d..d3fe6a6 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -471,7 +471,6 @@ static int adp5588_gpio_remove(struct i2c_client *client)
 
 	gpiochip_remove(&dev->gpio_chip);
 
-	kfree(dev);
 	return 0;
 }
 
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index a17b81f..2fc7ff8 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -1008,7 +1008,7 @@ static int mcp23s08_remove(struct spi_device *spi)
 			mcp23s08_irq_teardown(data->mcp[addr]);
 		gpiochip_remove(&data->mcp[addr]->chip);
 	}
-	kfree(data);
+
 	return 0;
 }
 
-- 
1.7.9.5


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

* Re: [PATCH gpio] gpio: removing kfree remove functionality
  2015-04-07 16:04 [PATCH gpio] gpio: removing kfree remove functionality Varka Bhadram
@ 2015-04-08 14:54 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2015-04-08 14:54 UTC (permalink / raw)
  To: Varka Bhadram; +Cc: linux-gpio, Johan Hovold, Alexandre Courbot

On Tue, Apr 7, 2015 at 6:04 PM, Varka Bhadram <varkabhadram@gmail.com> wrote:

> commit 3de07e5aaf290a0b58919 ("drivers: gpio: use devm_kzalloc")
> introduce devm_kzalloc() for allocating the memory. In this case kfree
> is not required to use. Above commit id introduced the bug that kfree
> is not removed from the remove function.
>
> This patch fix the above bug.
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>

Patch applied.

BTW these "deep cleanups" are much appreciated.

Yours,
Linus Walleij

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

end of thread, other threads:[~2015-04-08 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 16:04 [PATCH gpio] gpio: removing kfree remove functionality Varka Bhadram
2015-04-08 14:54 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.