lan78xx: USB fast connect/disconnect crash fix
authorNisar Sayed <Nisar.Sayed@microchip.com>
Tue, 1 Aug 2017 10:24:17 +0000 (10:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Aug 2017 17:39:58 +0000 (10:39 -0700)
commitfb52c3b597f0b44e893ded8c253845561f9f57da
treec36011f60ae624e48fbe42646e8e9df2a4c56fc3
parent12c5d0c0485fd03127e24848af0f0aff399d2db9
lan78xx: USB fast connect/disconnect crash fix

USB fast connect/disconnect crash fix

When USB plugged/unplugged at fast rate,
lan78xx_mdio_init() in lan78xx_bind() failing case is not handled.
Whenever  lan78xx_mdio_init() failed, dev->mdiobus will be freed, however
since lan78xx_bind() not consider as error and try to proceed for
further initialization in lan78xx_probe() which leads system hung/crash.
Also when register_netdev() failed, netdev is freed without calling lan78xx_unbind().
Hence halting the failed cases right manner fixes the system crash/hung issue.

Signed-off-by: Nisar Sayed <Nisar.Sayed@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/lan78xx.c