mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
pinctrl: nsp: off by ones in nsp_pinmux_enable()
The > comparisons should be >= or else we read beyond the end of the
pinctrl->functions[] array.
Fixes: cc4fa83f66
("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
550b6f7e8c
commit
f90a21c898
1 changed files with 2 additions and 2 deletions
|
@ -460,8 +460,8 @@ static int nsp_pinmux_enable(struct pinctrl_dev *pctrl_dev,
|
||||||
const struct nsp_pin_function *func;
|
const struct nsp_pin_function *func;
|
||||||
const struct nsp_pin_group *grp;
|
const struct nsp_pin_group *grp;
|
||||||
|
|
||||||
if (grp_select > pinctrl->num_groups ||
|
if (grp_select >= pinctrl->num_groups ||
|
||||||
func_select > pinctrl->num_functions)
|
func_select >= pinctrl->num_functions)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
func = &pinctrl->functions[func_select];
|
func = &pinctrl->functions[func_select];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue