[PATCH 1/2] power: regulator: gpio-regulator: protect count value

Tom Rini trini at konsulko.com
Sat Oct 24 16:51:16 CEST 2020


On Thu, Sep 10, 2020 at 06:18:16PM +0200, Patrick Delaunay wrote:

> 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 at st.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201024/b7248f0a/attachment.sig>


More information about the U-Boot mailing list