pinctrl: single: Fix missing unlock on error path
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 11 Jul 2018 12:33:31 +0000 (12:33 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Jul 2018 08:50:05 +0000 (10:50 +0200)
Add the missing unlock before return from function
in the error handling case.

Fixes: 0f5972033509 ("pinctrl: single: Fix group and function selector use")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-single.c

index 42d7e76..9fa2f54 100644 (file)
@@ -1071,8 +1071,8 @@ free_pingroups:
        *num_maps = 1;
 free_function:
        pinmux_generic_remove_function(pcs->pctl, fsel);
-       mutex_unlock(&pcs->mutex);
 free_pins:
+       mutex_unlock(&pcs->mutex);
        devm_kfree(pcs->dev, pins);
 
 free_vals:
@@ -1211,8 +1211,8 @@ free_pingroups:
        *num_maps = 1;
 free_function:
        pinmux_generic_remove_function(pcs->pctl, fsel);
-       mutex_unlock(&pcs->mutex);
 free_pins:
+       mutex_unlock(&pcs->mutex);
        devm_kfree(pcs->dev, pins);
 
 free_vals: