regulator: act8865: fix parsing of platform data
authorBeniamino Galvani <b.galvani@gmail.com>
Sun, 22 Jun 2014 15:31:41 +0000 (17:31 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 5 Aug 2014 17:02:51 +0000 (18:02 +0100)
The driver loops through all available regulators (ACT8865_REG_NUM)
and accesses pdata->regulators[i].platform_data without checking the
actual value of num_regulators in platform data, potentially causing a
invalid memory access.

Fix this and look up the regulator init_data by id in platform data.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by Wenyou.Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

No differences found