From 2ce7c62d1b18dca13c715c6bc2eea17f723576ff Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Thu, 11 Apr 2013 21:23:22 +0400 Subject: GPIO: gpio-generic: remove kfree() from bgpio_remove call Memory for basic-mmio-gpio driver is allocated by the driver using it, whether it's the generic GPIO driver itself or another driver. In either case, the owner shall allocate and free the struct bgpio_chip it is using, preferably using a managed resource. Signed-off-by: Alexander Shiyan Signed-off-by: Linus Walleij --- drivers/gpio/gpio-generic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/gpio/gpio-generic.c') diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c index 42d470632aea..d2196bf73847 100644 --- a/drivers/gpio/gpio-generic.c +++ b/drivers/gpio/gpio-generic.c @@ -390,11 +390,7 @@ static int bgpio_setup_direction(struct bgpio_chip *bgc, int bgpio_remove(struct bgpio_chip *bgc) { - int err = gpiochip_remove(&bgc->gc); - - kfree(bgc); - - return err; + return gpiochip_remove(&bgc->gc); } EXPORT_SYMBOL_GPL(bgpio_remove); -- cgit v1.2.3