aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-10-26 09:59:43 +0300
committerLinus Walleij <linus.walleij@linaro.org>2012-10-26 09:35:17 +0200
commit529f2ad5e374f61987a8312603963c61d75a890a (patch)
treed779beedcbd3895a77526792351d3ce8eb67e7c0 /drivers/gpio/gpiolib.c
parent80b0a6029272247f19146bf8f88e5d4bba94cba5 (diff)
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>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e468eed261c..fd2b71c7099 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)