Skip to content

Commit

Permalink
gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
Browse files Browse the repository at this point in the history
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: 0769746 ("gpiolib: add support for changing value polarity in sysfs")
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: franciscofranco <[email protected]>
  • Loading branch information
jhovold authored and franciscofranco committed Oct 6, 2016
1 parent c567fd3 commit dc3cedb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ static 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);

Expand Down

0 comments on commit dc3cedb

Please sign in to comment.