Re: [PATCH] phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
From: Vinod Koul
Date: Mon Jul 24 2023 - 06:56:48 EST
On Fri, 21 Jul 2023 02:05:55 -0700, Harshit Mogalapalli wrote:
> The size of array 'priv->ports[]' is INNO_PHY_PORT_NUM.
>
> In the for loop, 'i' is used as the index for array 'priv->ports[]'
> with a check (i > INNO_PHY_PORT_NUM) which indicates that
> INNO_PHY_PORT_NUM is allowed value for 'i' in the same loop.
>
> This > comparison needs to be changed to >=, otherwise it potentially leads
> to an out of bounds write on the next iteration through the loop
>
> [...]
Applied, thanks!
[1/1] phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
commit: 13c088cf3657d70893d75cf116be937f1509cc0f
Best regards,
--
~Vinod