Skip to content

Commit

Permalink
mfd: Don't free unallocated arizona supplies on error
Browse files Browse the repository at this point in the history
ARRAY_SIZE() may be larger than the number of supplies actually used.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Jul 8, 2012
1 parent 863df8d commit 3a36a0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ int __devinit arizona_dev_init(struct arizona *arizona)
err_dcvdd:
regulator_disable(arizona->dcvdd);
err_enable:
regulator_bulk_disable(ARRAY_SIZE(arizona->core_supplies),
regulator_bulk_disable(arizona->num_core_supplies,
arizona->core_supplies);
err_early:
mfd_remove_devices(dev);
Expand Down

0 comments on commit 3a36a0d

Please sign in to comment.