diff options
author | Johan Hovold <johan@kernel.org> | 2015-01-26 12:02:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-11 15:00:50 +0800 |
commit | 64f2260ea24f94ecca7d8619e9c6d250ef9ff465 (patch) | |
tree | 0b571d05f4f157d5cba038d62af2a2abaffd19c6 /drivers/gpio | |
parent | 22f837c860eb7e1d237f5ba91101805df37be1d7 (diff) | |
download | lwn-64f2260ea24f94ecca7d8619e9c6d250ef9ff465.tar.gz lwn-64f2260ea24f94ecca7d8619e9c6d250ef9ff465.zip |
gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
commit 49d2ca84e433dab854c7a866bc6add09cfab682d upstream.
Fix memory leak in the gpio sysfs interface due to failure to drop
reference to device returned by class_find_device when setting the
gpio-line polarity.
Fixes: 0769746183ca ("gpiolib: add support for changing value polarity in sysfs")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 9d413f77bb83..aed7dd6e9dca 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -678,7 +678,7 @@ int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value) } status = sysfs_set_active_low(desc, dev, value); - + put_device(dev); unlock: mutex_unlock(&sysfs_lock); |