From: Vladimir Zapolskiy Date: Thu, 21 Dec 2017 16:37:35 +0000 (+0200) Subject: gpiolib: add desc validation to gpiod_set_transitory() X-Git-Tag: v5.15~9534^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=156dd39219b159d03762af32f1a0acd05d0cd726;p=platform%2Fkernel%2Flinux-starfive.git gpiolib: add desc validation to gpiod_set_transitory() The gpiod_set_transitory() function is publicly exported, and it is expected from it to be ready for usage with optional GPIOs on consumer's side. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index c23cc6b..7dde703b 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2526,6 +2526,7 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory) int gpio; int rc; + VALIDATE_DESC(desc); /* * Handle FLAG_TRANSITORY first, enabling queries to gpiolib for * persistence state.