提交 e254811c 编写于 作者: A Aaro Koskinen 提交者: Linus Torvalds

gpiolib: gpio_request_one(): add missing gpio_free()

If GPIO request succeeds, but configuration fails, it should be released.
Signed-off-by: NAaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: NEric Miao <eric.miao@canonical.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d153ba64
......@@ -1281,6 +1281,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
err = gpio_direction_output(gpio,
(flags & GPIOF_INIT_HIGH) ? 1 : 0);
if (err)
gpio_free(gpio);
return err;
}
EXPORT_SYMBOL_GPL(gpio_request_one);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册