]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:39 +0000 (07:17 +0100)
commit71e1c77a332973c70611dda8f82f599c87c7bb3d
tree7629f6692b0dea31bb2badfffc361e1338b13d31
parent58b77fb081b3cb9963bb514252d3e70eba4f2e5a
net: dsa: fix phylink_start()/phylink_stop() calls

[ Upstream commit 41c7af0ff67362dd4f9c2fe10dfc96a1515a0c6a ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c