forked from Minki/linux
pinctrl: single: fix pinctrl_spec.args_count bounds check
The property #pinctrl-cells can either be 1 or 2:
- if #pinctrl-cells = <1>, then pinctrl_spec.args_count = 2
- if #pinctrl-cells = <2>, then pinctrl_spec.args_count = 3
All other values of pinctrl_spec.args_count are incorrect. This fix
checks the upper bound instead of just the lower bound.
Fixes: a133954188
("pinctrl: single: parse #pinctrl-cells = 2")
Reported-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/linux-omap/3139716.CMS8C0sQ7x@zen.local/
Link: https://lore.kernel.org/r/20200930174839.1308344-1-drew@beagleboard.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
a0cec28c96
commit
9b9448f39e
@ -1014,7 +1014,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
if (pinctrl_spec.args_count < 2) {
|
||||
if (pinctrl_spec.args_count < 2 || pinctrl_spec.args_count > 3) {
|
||||
dev_err(pcs->dev, "invalid args_count for spec: %i\n",
|
||||
pinctrl_spec.args_count);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user