Skip to content

Commit

Permalink
gpiolib: unlock on error in gpio_export()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Oct 26, 2012
1 parent 80b0a60 commit 529f2ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 529f2ad

Please sign in to comment.