regulator: act8865: fix parsing of platform data
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: NBeniamino Galvani <b.galvani@gmail.com> Tested-by Wenyou.Yang <wenyou.yang@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
Showing
想要评论请 注册 或 登录