aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-10-26 02:59:43 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-10-26 03:35:17 -0400
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 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)
756 __func__, gpio, 756 __func__, gpio,
757 test_bit(FLAG_REQUESTED, &desc->flags), 757 test_bit(FLAG_REQUESTED, &desc->flags),
758 test_bit(FLAG_EXPORT, &desc->flags)); 758 test_bit(FLAG_EXPORT, &desc->flags));
759 return -EPERM; 759 status = -EPERM;
760 goto fail_unlock;
760 } 761 }
761 762
762 if (!desc->chip->direction_input || !desc->chip->direction_output) 763 if (!desc->chip->direction_input || !desc->chip->direction_output)