]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerZefan Li <lizefan@huawei.com>
Tue, 14 Apr 2015 09:33:59 +0000 (17:33 +0800)
commit2e835e9f16acd0fd6ace354b62715c05979c96bf
tree9b5fb6b05dbeb0b3fbc6c74d89c799aa3b0d2406
parent8566a606c062d4ff1982250c96740e8b4e9c8758
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>
[lizf: Backported to 3.4: adjust filename]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/gpio/gpiolib.c