Skip to content

Commit 129c1cb

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 9c21fc4 commit 129c1cb

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
@@ -3565,13 +3565,13 @@ ixgbe_get_eee_fw(struct ixgbe_adapter *adapter, struct ethtool_keee *edata)
35653565

35663566
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
35673567
if (hw->phy.eee_speeds_supported & ixgbe_ls_map[i].mac_speed)
3568-
linkmode_set_bit(ixgbe_lp_map[i].link_mode,
3568+
linkmode_set_bit(ixgbe_ls_map[i].link_mode,
35693569
edata->supported);
35703570
}
35713571

35723572
for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) {
35733573
if (hw->phy.eee_speeds_advertised & 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->advertised);
35763576
}
35773577

0 commit comments

Comments
 (0)