Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tg3: copy only needed fields from userspace-provided EEE data

The current code overwrites fields in tp->eee with unchecked data from
edata, e.g. the bitmap with supported modes. ethtool properly returns
the received data from get_eee() call, but we have no guarantee that
other users of the ioctl set_eee() interface behave properly too.
Therefore copy only fields which are actually needed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Heiner Kallweit and committed by
David S. Miller
8306ee08 b0117d13

+3 -1
+3 -1
drivers/net/ethernet/broadcom/tg3.c
··· 14200 14200 return -EINVAL; 14201 14201 } 14202 14202 14203 - tp->eee = *edata; 14203 + tp->eee.eee_enabled = edata->eee_enabled; 14204 + tp->eee.tx_lpi_enabled = edata->tx_lpi_enabled; 14205 + tp->eee.tx_lpi_timer = edata->tx_lpi_timer; 14204 14206 14205 14207 tp->phy_flags |= TG3_PHYFLG_USER_CONFIGURED; 14206 14208 tg3_warn_mgmt_link_flap(tp);