• John Efstathiades's avatar
    lan78xx: Fix race condition in disconnect handling · 77dfff5b
    John Efstathiades authored
    If there is a device disconnect at roughly the same time as a
    deferred PHY link reset there is a race condition that can result
    in a kernel lock up due to a null pointer dereference in the
    driver's deferred work handling routine lan78xx_delayedwork().
    The following changes fix this problem.
    
    Add new status flag EVENT_DEV_DISCONNECT to indicate when the
    device has been removed and use it to prevent operations, such as
    register access, that will fail once the device is removed.
    
    Stop processing of deferred work items when the driver's USB
    disconnect handler is invoked.
    
    Disconnect the PHY only after the network device has been
    unregistered and all delayed work has been cancelled.
    Signed-off-by: default avatarJohn Efstathiades <john.efstathiades@pebblebay.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    77dfff5b
lan78xx.c 111 KB