]> 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)
commitd688d4a4a9d628d32feb880d76e40744394954cb
tree4ae04c34ed6e6b86314e9aa25feda0c8eaa0bff0
parent7177ba0f86c9b1842011e13b2167eb0e0561d75f
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: c1910b518be1 ("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