]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gpiolib: unlock on error in gpio_export()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 26 Oct 2012 06:59:43 +0000 (09:59 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 26 Oct 2012 07:35:17 +0000 (09:35 +0200)
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>
drivers/gpio/gpiolib.c

index e468eed261c5c48eebcd8695b37208f6ee6c7efb..fd2b71c7099769f12e48be87d80f5f9714894deb 100644 (file)
@@ -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)