Commit 302fc0cf authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()

BugLink: https://bugs.launchpad.net/bugs/1792392

commit 19da44cd upstream.

The info->groups[] array is allocated in imx1_pinctrl_parse_dt().  It
has info->ngroups elements.  Thus the > here should be >= to prevent
reading one element beyond the end of the array.

Cc: stable@vger.kernel.org
Fixes: 30612cd9 ("pinctrl: imx1 core driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-könig@pengutronix.de>
Acked-by: default avatarDong Aisheng <Aisheng.dong@nxp.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 57b0693c
......@@ -434,7 +434,7 @@ static void imx1_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
const char *name;
int i, ret;
if (group > info->ngroups)
if (group >= info->ngroups)
return;
seq_puts(s, "\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment