Skip to content
Commit 2d69b086 authored by Patrick Delaunay's avatar Patrick Delaunay Committed by Tom Rini
Browse files

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: default avatarPatrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 86eeac7b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment