gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
authorJohan Hovold <johan@kernel.org>
Mon, 26 Jan 2015 11:02:46 +0000 (12:02 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 6 Mar 2015 00:39:18 +0000 (00:39 +0000)
commit4a5233cccf2599f8ae122ae6327cb2a2dce8c429
treeafb051e61b3e7050d53d6aa09a6d200054aeba5a
parent67cb64715f1edfa5e05812bf70913c18d065421c
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>
drivers/gpio/gpiolib.c