• Benjamin Li's avatar
    bnx2: Fix netpoll crash. · 4327ba43
    Benjamin Li authored
    The bnx2 driver calls netif_napi_add() for all the NAPI structs during
    ->probe() time but not all of them will be used if we're not in MSI-X
    mode.  This creates a problem for netpoll since it will poll all the
    NAPI structs in the dev_list whether or not they are scheduled, resulting
    in a crash when we access structure fields not initialized for that vector.
    
    We fix it by moving the netif_napi_add() call to ->open() after the number
    of IRQ vectors has been determined.
    Signed-off-by: default avatarBenjamin Li <benli@broadcom.com>
    Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4327ba43
bnx2.c 206 KB