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

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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);