Skip to content

Commit b7e5c3e

Browse files
aloktiwaanguy11
authored andcommitted
ixgbe: fix incorrect map used in eee linkmode
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 <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Paul Menzel <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent a556f06 commit b7e5c3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

35723572
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
35733573
if (hw->phy.eee_speeds_supported & ixgbe_ls_map[i].mac_speed)
3574-
linkmode_set_bit(ixgbe_lp_map[i].link_mode,
3574+
linkmode_set_bit(ixgbe_ls_map[i].link_mode,
35753575
edata->supported);
35763576
}
35773577

35783578
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
35793579
if (hw->phy.eee_speeds_advertised & ixgbe_ls_map[i].mac_speed)
3580-
linkmode_set_bit(ixgbe_lp_map[i].link_mode,
3580+
linkmode_set_bit(ixgbe_ls_map[i].link_mode,
35813581
edata->advertised);
35823582
}
35833583

0 commit comments

Comments
 (0)