summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2015-01-26 12:02:46 +0100
committerBen Hutchings <ben@decadent.org.uk>2015-03-06 00:39:18 +0000
commit4a5233cccf2599f8ae122ae6327cb2a2dce8c429 (patch)
treeafb051e61b3e7050d53d6aa09a6d200054aeba5a
parent67cb64715f1edfa5e05812bf70913c18d065421c (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> [bwh: Backported to 3.2: adjust filename] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-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 72ebde423081..36ae0555f5a0 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -872,7 +872,7 @@ int gpio_sysfs_set_active_low(unsigned gpio, int value)
}
status = sysfs_set_active_low(desc, dev, value);
-
+ put_device(dev);
unlock:
mutex_unlock(&sysfs_lock);