[1/6] gpio: remember to finally free gpio_device

Message ID 1455186383-28004-2-git-send-email-linus.walleij@linaro.org
State New
Headers show

Commit Message

Linus Walleij Feb. 11, 2016, 10:26 a.m.
When the device core reference count for the device goes to
0 and it calls .release() we free resources and so can also
finally free up the GPIO state container, struct gpio_device.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

 drivers/gpio/gpiolib.c | 1 +
 1 file changed, 1 insertion(+)


To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 70e0fff0a8a7..36f8be3f910b 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -405,6 +405,7 @@  static void gpiodevice_release(struct device *dev)
 	ida_simple_remove(&gpio_ida, gdev->id);
+	kfree(gdev);