]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: fix phylink_start()/phylink_stop() calls
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 3 Mar 2020 15:01:46 +0000 (15:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Mar 2020 23:45:49 +0000 (15:45 -0800)
commit41c7af0ff67362dd4f9c2fe10dfc96a1515a0c6a
tree6f99a9e8436b274adc01c4cf79c6476b60af6c2f
parent395dd97140522a87ec1689b70a3e4120acb9a521
net: dsa: fix phylink_start()/phylink_stop() calls

Place phylink_start()/phylink_stop() inside dsa_port_enable() and
dsa_port_disable(), which ensures that we call phylink_stop() before
tearing down phylink - which is a documented requirement.  Failure
to do so can cause use-after-free bugs.

Fixes: 5f71d95619ea ("net: dsa: Use PHYLINK for the CPU/DSA ports")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c