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 e468eed..fd2b71c 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)