]> git.baikalelectronics.ru Git - kernel.git/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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Oct 2021 13:06:43 +0000 (14:06 +0100)
commitc10a485c3de5ccbf1fff65a382cebcb2730c6b06
tree694033b093dc000bba571f9ff618132d1d2be074
parent95a359c9553342d36d408d35331ff0bfce75272f
phy: phy_ethtool_ksettings_get: Lock the phy for consistency

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>
drivers/net/phy/phy.c