Skip to content

Commit

Permalink
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
Browse files Browse the repository at this point in the history
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: 30612cd ("pinctrl: imx1 core driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Uwe Kleine-König <u.kleine-könig@pengutronix.de>
Acked-by: Dong Aisheng <Aisheng.dong@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Aug 1, 2018
1 parent 24d1c21 commit 19da44c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/freescale/pinctrl-imx1-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,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");
Expand Down

0 comments on commit 19da44c

Please sign in to comment.