diff options
| author | Harshit Mogalapalli <[email protected]> | 2023-07-21 09:05:55 +0000 |
|---|---|---|
| committer | Vinod Koul <[email protected]> | 2023-07-24 10:53:37 +0000 |
| commit | 13c088cf3657d70893d75cf116be937f1509cc0f (patch) | |
| tree | 7df2800ceb49ca16f07d486b667fd661a04458bc /drivers/net/ethernet/intel/igc/igc_main.c | |
| parent | phy: qcom-snps-femto-v2: use qcom_snps_hsphy_suspend/resume error code (diff) | |
| download | kernel-13c088cf3657d70893d75cf116be937f1509cc0f.tar.gz kernel-13c088cf3657d70893d75cf116be937f1509cc0f.zip | |
phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
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
Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Harshit Mogalapalli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions
