From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 26 Oct 2012 06:59:43 +0000 (+0300)
Subject: gpiolib: unlock on error in gpio_export()
X-Git-Tag: v3.8-rc1~181^2~23
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=529f2ad5e374f61987a8312603963c61d75a890a;p=users%2Fjedix%2Flinux-maple.git

gpiolib: unlock on error in gpio_export()

We need to unlock here before returning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e468eed261c5..fd2b71c70997 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -756,7 +756,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)