mfd: Don't free unallocated arizona supplies on error
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 8 Jul 2012 22:45:53 +0000 (00:45 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 8 Jul 2012 22:45:53 +0000 (00:45 +0200)
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>
drivers/mfd/arizona-core.c

index 7f837edfbfb7c3410bd0a523c8b1a781dee34e83..5cbacf6e2bf79531417e4a8aae0cb931cc6048cd 100644 (file)
@@ -514,7 +514,7 @@ err_reset:
 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);