Răsfoiți Sursa

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 <shc_work@mail.ru>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Alexander Shiyan 12 ani în urmă
părinte
comite
2ce7c62d1b
1 a modificat fișierele cu 1 adăugiri și 5 ștergeri
  1. 1 5
      drivers/gpio/gpio-generic.c

+ 1 - 5
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 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);
 EXPORT_SYMBOL_GPL(bgpio_remove);