Skip to content

Commit

Permalink
regulator: add check index of wm8350->pmic.pdev[]
Browse files Browse the repository at this point in the history
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Roel Kluin authored and Liam Girdwood committed Sep 22, 2009
1 parent 43c1266 commit 4dee4d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/wm8350-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4dee4d4

Please sign in to comment.