regulator: add check index of wm8350->pmic.pdev[]
PATCH 1/1 regulator: add check index of wm8350->pmic.pdev[]
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
Signed-off-by Roel Kluin <[email protected]>
---
drivers/regulator/wm8350-regulator.c +2 -0
@@ -1419,6 +1419,8 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, {struct platform_device *pdev;int ret; +if (reg <0 || reg >=NUM_WM8350_REGULATORS ) +return -EINVAL ;if (wm8350->pmic.pdev[reg])return -EBUSY ;
Quoted 3 lines · Roel Kluin
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
Signed-off-by Roel Kluin <[email protected]>
Acked-by Mark Brown <[email protected]>
Liam Girdwood
AppliedQuoted 9 lines · Roel Kluin
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
Signed-off-by Roel Kluin <[email protected]>---
drivers/regulator/wm8350-regulator.c +0
-0
drivers/regulator/wm8350-regulator.c int wm8350_register_regulator(struct wm8350 *wm8350, int reg, · line 1426
Quoted 8 lines
drivers/regulator/wm8350-regulator.c +2
-0@@ -1419,6 +1419,8 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, {struct platform_device *pdev;int ret; +if (reg <0 || reg >=NUM_WM8350_REGULATORS ) +return -EINVAL ;if (wm8350->pmic.pdev[reg])return -EBUSY ;
Applied.
Thanks.
Liam