Skip to contentSkip to conversation

gpiolib: add desc validation to gpiod_set_transitory()

PATCH In review Vladimir Zapolskiy 2 participants 2 messages Dec 21, 2017 – Jan 2, 2018 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpio/gpiolib.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib.c +1 -0
index 6e19385..a34ea9d 100644
@@ -2546,6 +2546,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.
Signature · 1 line
2.10.2
#1 lore raw
Quoted 5 lines · Vladimir Zapolskiy

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.

Patch applied.

Yours,
Linus Walleij