Skip to content

Commit 682105a

Browse files
aloktiwagregkh
authored andcommitted
ixgbe: fix incorrect map used in eee linkmode
[ Upstream commit b7e5c3e ] incorrectly used ixgbe_lp_map in loops intended to populate the supported and advertised EEE linkmode bitmaps based on ixgbe_ls_map. This results in incorrect bit setting and potential out-of-bounds access, since ixgbe_lp_map and ixgbe_ls_map have different sizes and purposes. ixgbe_lp_map[i] -> ixgbe_ls_map[i] Use ixgbe_ls_map for supported and advertised linkmodes, and keep ixgbe_lp_map usage only for link partner (lp_advertised) mapping. Fixes: 9356b6d ("net: ethernet: ixgbe: Convert EEE to use linkmodes") Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 66e7cdb commit 682105a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,13 +3443,13 @@ ixgbe_get_eee_fw(struct ixgbe_adapter *adapter, struct ethtool_keee *edata)
34433443

34443444
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
34453445
if (hw->phy.eee_speeds_supported & ixgbe_ls_map[i].mac_speed)
3446-
linkmode_set_bit(ixgbe_lp_map[i].link_mode,
3446+
linkmode_set_bit(ixgbe_ls_map[i].link_mode,
34473447
edata->supported);
34483448
}
34493449

34503450
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
34513451
if (hw->phy.eee_speeds_advertised & ixgbe_ls_map[i].mac_speed)
3452-
linkmode_set_bit(ixgbe_lp_map[i].link_mode,
3452+
linkmode_set_bit(ixgbe_ls_map[i].link_mode,
34533453
edata->advertised);
34543454
}
34553455

0 commit comments

Comments
 (0)