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
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")
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>
  • Loading branch information
Johan Hovold authored and Linus Walleij committed Jan 30, 2015
1 parent 0f303db commit 49d2ca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpiolib-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 49d2ca8

Please sign in to comment.