Skip to contentSkip to conversation

gpiolib: unlock on error in gpio_export()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: unlock on error in gpio_export()

We need to unlock here before returning.

---
Only needed in linux-next.

drivers/gpio/gpiolib.c +2 -1
index d5f9742..14251c3 100644
@@ -728,7 +728,8 @@ int gpio_export(unsigned gpio, bool direction_may_change)
 				__func__, gpio,
 				test_bit(FLAG_REQUESTED, &desc->flags),
 				test_bit(FLAG_EXPORT, &desc->flags));
-		return -EPERM;
+		status = -EPERM;
+		goto fail_unlock;
 	}
 
 	if (!desc->chip->direction_input || !desc->chip->direction_output)