Browse Source

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 <vz@mleia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Vladimir Zapolskiy 7 years ago
parent
commit
156dd39219
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/gpio/gpiolib.c

+ 1 - 0
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.