aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2015-01-26 12:02:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-11 14:54:45 +0800
commit2739bb7a0087d57dc75f897fee2ef1407f2c3f08 (patch)
treec926c030db3003801afbc9dc3b25b09d71bb3192
parent3adca859271e324203be08f2db54f0f685a66f9a (diff)
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>
-rw-r--r--drivers/gpio/gpiolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d95c2000a727..8f42bd724682 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -959,7 +959,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);