• wangweidong's avatar
    BNX2: fix a Null Pointer for stats_blk · 8fae307c
    wangweidong authored
    we have two processes to do:
    P1#: ifconfig eth0 down; which will call bnx2_close, then will
    , and set Null to stats_blk
    P2#: ifconfig eth0; which will call bnx2_get_stats64, it will
    use stats_blk.
    In one case:
        --P1#--                   --P2#--
                                  stats_blk(no null)
        bnx2_free_mem
        ->bp->stats_blk = NULL
                                  GET_64BIT_NET_STATS
    
    then it will cause 'NULL Pointer' Problem.
    it is as well with 'ethtool -S ethx'.
    
    Allocate the statistics block at probe time so that this problem is
    impossible
    Signed-off-by: default avatarWang Weidong <wangweidong1@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8fae307c
bnx2.c 216 KB