diff options
| author | Johan Hovold <johan@kernel.org> | 2015-01-26 06:02:46 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-30 04:29:33 -0500 |
| commit | 49d2ca84e433dab854c7a866bc6add09cfab682d (patch) | |
| tree | d45d58ae64b77999e3cb93f61194f0baabe68e14 | |
| parent | 0f303db08df0df9bd0966443ad6001e63960af16 (diff) | |
gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
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")
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>
| -rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 4667830f350e..7722ed53bd65 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c | |||
| @@ -696,7 +696,7 @@ int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value) | |||
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | status = sysfs_set_active_low(desc, dev, value); | 698 | status = sysfs_set_active_low(desc, dev, value); |
| 699 | 699 | put_device(dev); | |
| 700 | unlock: | 700 | unlock: |
| 701 | mutex_unlock(&sysfs_lock); | 701 | mutex_unlock(&sysfs_lock); |
| 702 | 702 | ||
