]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: fix missing unlock on error in pinctrl_groups_show()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 22 Oct 2012 04:58:09 +0000 (12:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Oct 2012 17:56:15 +0000 (10:56 -0700)
commit b4dd784ba8af03bf1f9ee5118c792d7abd4919bd upstream.

Add the missing unlock on the error handle path in function
pinctrl_groups_show().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/core.c

index dc5c126e398a0ac84fc13fa5f564d832ade0831e..63560c3a322c56457a8c0e6900f52d730f29f2a0 100644 (file)
@@ -1059,8 +1059,10 @@ static int pinctrl_groups_show(struct seq_file *s, void *what)
                        seq_printf(s, "group: %s\n", gname);
                        for (i = 0; i < num_pins; i++) {
                                pname = pin_get_name(pctldev, pins[i]);
-                               if (WARN_ON(!pname))
+                               if (WARN_ON(!pname)) {
+                                       mutex_unlock(&pinctrl_mutex);
                                        return -EINVAL;
+                               }
                                seq_printf(s, "pin %d (%s)\n", pins[i], pname);
                        }
                        seq_puts(s, "\n");