diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2018-04-16 14:17:53 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-04-27 01:43:03 +0300 |
commit | f001cc351ad3309ec8736c374e90e5a4bc472d41 (patch) | |
tree | bda50b5256547fc45dfabf35f0c2c99d028e5c07 /drivers/gpio/gpiolib.c | |
parent | ab3dbcf78f60f46d6a0ad63b1f4b690b7a427140 (diff) | |
download | linux-f001cc351ad3309ec8736c374e90e5a4bc472d41.tar.xz |
gpio: fix error path in lineevent_create
If gpiod_request() fails the cleanup must not call gpiod_free().
Cc: stable@vger.kernel.org
Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d07771797707..d8ccb500872f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -903,7 +903,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) desc = &gdev->descs[offset]; ret = gpiod_request(desc, le->label); if (ret) - goto out_free_desc; + goto out_free_label; le->desc = desc; le->eflags = eflags; |