summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-04-16 14:17:53 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-04-27 01:43:03 +0300
commitf001cc351ad3309ec8736c374e90e5a4bc472d41 (patch)
treebda50b5256547fc45dfabf35f0c2c99d028e5c07 /drivers/gpio/gpiolib.c
parentab3dbcf78f60f46d6a0ad63b1f4b690b7a427140 (diff)
downloadlinux-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.c2
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;