• Guilherme G. Piccoli's avatar
    cxgb4: avoid crash on PCI error recovery path · 025d0973
    Guilherme G. Piccoli authored
    During PCI error recovery process, specifically on eeh_err_detected()
    we might have a NULL netdev struct, hence a direct dereference will
    lead to a kernel oops. This was observed with latest upstream kernel
    (v4.12-rc2) on Chelsio adapter T422-CR in PowerPC machines.
    
    This patch checks for NULL pointer and avoids the crash, both in
    eeh_err_detected() and eeh_resume(). Also, we avoid to trigger
    a fatal error or to try disabling interrupts on FW during PCI
    error recovery, because: (a) driver might not be able to accurately
    access PCI regions in this case, and (b) trigger a fatal error
    _during_ the recovery steps is a mistake that could prevent the
    recovery path to complete successfully.
    Reported-by: default avatarHarsha Thyagaraja <hathyaga@in.ibm.com>
    Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    025d0973
t4_hw.c 240 KB