]> git.itanic.dy.fi Git - linux-stable/commit
phy: phy_ethtool_ksettings_get: Lock the phy for consistency
authorAndrew Lunn <andrew@lunn.ch>
Sun, 24 Oct 2021 19:48:02 +0000 (21:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Nov 2021 18:46:14 +0000 (19:46 +0100)
commitc85b696270db3bf5c57fc0eb30548cfafc00bc3a
treeb0c90dfdca1c3a3184660c8bee87e35ce75136df
parent0dea6379e273dba1cd7e19aad298f8c59f75288c
phy: phy_ethtool_ksettings_get: Lock the phy for consistency

commit c10a485c3de5ccbf1fff65a382cebcb2730c6b06 upstream.

The PHY structure should be locked while copying information out if
it, otherwise there is no guarantee of self consistency. Without the
lock the PHY state machine could be updating the structure.

Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phy.c