]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Nov 2021 18:46:14 +0000 (19:46 +0100)
commit8682462657a8bbfe972dccb8a75c9b8cc3b0e291
treeb0c90dfdca1c3a3184660c8bee87e35ce75136df
parentcfabba81e9f1dc85011f494e7e73d1b2160f5412
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: b8d3899eefb1 ("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