Commit e254811c authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Linus Torvalds

gpiolib: gpio_request_one(): add missing gpio_free()

If GPIO request succeeds, but configuration fails, it should be released.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: default avatarEric Miao <eric.miao@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment