Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f001cc35 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Linus Walleij
Browse files

gpio: fix error path in lineevent_create



If gpiod_request() fails the cleanup must not call gpiod_free().

Cc: stable@vger.kernel.org
Fixes: 61f922db ("gpio: userspace ABI for reading GPIO line events")
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent ab3dbcf7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;