gpio: remember to finally free gpio_device
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 9 Feb 2016 13:27:42 +0000 (14:27 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 11 Feb 2016 17:16:53 +0000 (18:16 +0100)
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

index 70e0fff0a8a7b951a767d86ac354471ccc5a9431..36f8be3f910b61799e271bcc4de9435e93a9fd48 100644 (file)
@@ -405,6 +405,7 @@ static void gpiodevice_release(struct device *dev)
        cdev_del(&gdev->chrdev);
        list_del(&gdev->list);
        ida_simple_remove(&gpio_ida, gdev->id);
+       kfree(gdev);
 }
 
 /**
This page took 0.027781 seconds and 5 git commands to generate.