提交 f001cc35 编写于 作者: U Uwe Kleine-König 提交者: Linus Walleij

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: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 ab3dbcf7
...@@ -903,7 +903,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) ...@@ -903,7 +903,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)
desc = &gdev->descs[offset]; desc = &gdev->descs[offset];
ret = gpiod_request(desc, le->label); ret = gpiod_request(desc, le->label);
if (ret) if (ret)
goto out_free_desc; goto out_free_label;
le->desc = desc; le->desc = desc;
le->eflags = eflags; le->eflags = eflags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册