]> git.baikalelectronics.ru Git - kernel.git/commit
net: usb: lan78xx: Connect PHY before registering MAC
authorAndrew Lunn <andrew@lunn.ch>
Thu, 17 Oct 2019 19:29:26 +0000 (21:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2019 17:22:04 +0000 (10:22 -0700)
commitb2dc824581226cdcc755e12b70578aacd18c6550
tree4ae04c34ed6e6b86314e9aa25feda0c8eaa0bff0
parentd152287ebf26a034bedee5c6a9dd4913ccba7da6
net: usb: lan78xx: Connect PHY before registering MAC

As soon as the netdev is registers, the kernel can start using the
interface. If the driver connects the MAC to the PHY after the netdev
is registered, there is a race condition where the interface can be
opened without having the PHY connected.

Change the order to close this race condition.

Fixes: 672df5b34fdd ("lan78xx: Connect phy early")
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/lan78xx.c