diff options
author | Ludovic Desroches <ludovic.desroches@atmel.com> | 2015-06-08 11:16:37 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-06-10 04:44:05 -0400 |
commit | 9d7ebbbf2264c4ad3c8d50fcb84952126184a7ad (patch) | |
tree | f9b10b71062bfb95a9e82afab792dce5f6e33dcf | |
parent | 1bb6fad359b147645e47cf826bc20e6b5b4d66b2 (diff) |
pinctrl: don't print unavailable function groups
There is no reason to try to print groups associated to a function if
get_function_groups returns an error. Moreover, it can lead to a NULL
pointer dereference error.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinmux.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 77f82b23f7be..e7ae890dcf1a 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -557,9 +557,12 @@ static int pinmux_functions_show(struct seq_file *s, void *what) | |||
557 | 557 | ||
558 | ret = pmxops->get_function_groups(pctldev, func_selector, | 558 | ret = pmxops->get_function_groups(pctldev, func_selector, |
559 | &groups, &num_groups); | 559 | &groups, &num_groups); |
560 | if (ret) | 560 | if (ret) { |
561 | seq_printf(s, "function %s: COULD NOT GET GROUPS\n", | 561 | seq_printf(s, "function %s: COULD NOT GET GROUPS\n", |
562 | func); | 562 | func); |
563 | func_selector++; | ||
564 | continue; | ||
565 | } | ||
563 | 566 | ||
564 | seq_printf(s, "function: %s, groups = [ ", func); | 567 | seq_printf(s, "function: %s, groups = [ ", func); |
565 | for (i = 0; i < num_groups; i++) | 568 | for (i = 0; i < num_groups; i++) |