• Mingming Cao's avatar
    ibmvnic fix NULL tx_pools and rx_tools issue at do_reset · 9f134573
    Mingming Cao authored
    At the time of do_rest, ibmvnic tries to re-initalize the tx_pools
    and rx_pools to avoid re-allocating the long term buffer. However
    there is a window inside do_reset that the tx_pools and
    rx_pools were freed before re-initialized making it possible to deference
    null pointers.
    
    This patch fix this issue by always check the tx_pool
    and rx_pool are not NULL after ibmvnic_login. If so, re-allocating
    the pools. This will avoid getting into calling reset_tx/rx_pools with
    NULL adapter tx_pools/rx_pools pointer. Also add null pointer check in
    reset_tx_pools and reset_rx_pools to safe handle NULL pointer case.
    Signed-off-by: default avatarMingming Cao <mmc@linux.vnet.ibm.com>
    Signed-off-by: default avatarDany Madden <drt@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9f134573
ibmvnic.c 143 KB