• Nisar Sayed's avatar
    lan78xx: USB fast connect/disconnect crash fix · fb52c3b5
    Nisar Sayed authored
    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: default avatarNisar Sayed <Nisar.Sayed@microchip.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fb52c3b5
lan78xx.c 98.2 KB