From: Ludovic Desroches Date: Mon, 8 Jun 2015 15:16:37 +0000 (+0200) Subject: pinctrl: don't print unavailable function groups X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d7ebbbf2264c4ad3c8d50fcb84952126184a7ad;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Linus Walleij --- 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) ret = pmxops->get_function_groups(pctldev, func_selector, &groups, &num_groups); - if (ret) + if (ret) { seq_printf(s, "function %s: COULD NOT GET GROUPS\n", func); + func_selector++; + continue; + } seq_printf(s, "function: %s, groups = [ ", func); for (i = 0; i < num_groups; i++)