tg3: copy only needed fields from userspace-provided EEE data
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 18 Feb 2024 14:49:55 +0000 (15:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2024 11:15:12 +0000 (11:15 +0000)
commit8306ee08c0ff1c78672bcc645544f26f4d652cca
tree112ee2daa2de0fffa3d2d53962bbb064e59e273d
parentb0117d136bb9e4a1facb7ce354e0580dde876f6b
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>
drivers/net/ethernet/broadcom/tg3.c