瀏覽代碼

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>
Dan Carpenter 12 年之前
父節點
當前提交
529f2ad5e3
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpio/gpiolib.c

+ 2 - 1
drivers/gpio/gpiolib.c

@@ -756,7 +756,8 @@ int gpio_export(unsigned gpio, bool direction_may_change)
 				__func__, gpio,
 				__func__, gpio,
 				test_bit(FLAG_REQUESTED, &desc->flags),
 				test_bit(FLAG_REQUESTED, &desc->flags),
 				test_bit(FLAG_EXPORT, &desc->flags));
 				test_bit(FLAG_EXPORT, &desc->flags));
-		return -EPERM;
+		status = -EPERM;
+		goto fail_unlock;
 	}
 	}
 
 
 	if (!desc->chip->direction_input || !desc->chip->direction_output)
 	if (!desc->chip->direction_input || !desc->chip->direction_output)