summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2015-01-26 12:02:46 +0100
committerLinus Walleij <linus.walleij@linaro.org>2015-01-30 10:29:33 +0100
commit49d2ca84e433dab854c7a866bc6add09cfab682d (patch)
treed45d58ae64b77999e3cb93f61194f0baabe68e14 /drivers/gpio
parent0f303db08df0df9bd0966443ad6001e63960af16 (diff)
gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
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") Cc: stable <stable@vger.kernel.org> # v2.6.33 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 4667830f350e..7722ed53bd65 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -696,7 +696,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);