diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2020-09-10 18:18:16 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-23 13:33:06 -0400 |
commit | 2d69b0861811711a27ac535fd8a611a9cdb68d43 (patch) | |
tree | 00b68e79d8ff6d1863ff1414499d56618990d37a /lib/linux_string.c | |
parent | 86eeac7bcf486de3f4182c2a084eff181b8c6e63 (diff) |
power: regulator: gpio-regulator: protect count value
Update the size of states_array to avoid overflow for
dev_pdata->voltages[j] and dev_pdata->states[j].
As the size of array is GPIO_REGULATOR_MAX_STATES, the size of
states_array is limited by GPIO_REGULATOR_MAX_STATES * 2 = 4
instead of 8 previously.
The value of the "count" variable is limited by the third parameter of
fdtdec_get_int_array_count.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/linux_string.c')
0 files changed, 0 insertions, 0 deletions