From c4941e072ed5ac1aaad7365ba1290fdd44e7058c Mon Sep 17 00:00:00 2001 From: Varka Bhadram Date: Tue, 7 Apr 2015 21:34:40 +0530 Subject: gpio: removing kfree remove functionality 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 Signed-off-by: Linus Walleij 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; } -- cgit v0.10.2