diff options
author | Nathan Fontenot <nfont@linux.vnet.ibm.com> | 2017-04-21 15:39:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-24 12:52:13 -0400 |
commit | 3ca1993264503957f81f3846598b16601b1e9457 (patch) | |
tree | 1c15b112f9610cb50b79ac78b9e37d86494e41b4 /drivers | |
parent | 53da09e92910f675ebb93921007428a3c2a024fb (diff) |
ibmvnic: Validate napi exist before disabling them
Validate that the napi structs exist before trying to disable them
at driver close.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 115f21694994..5a916a2f91be 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -729,8 +729,10 @@ static int ibmvnic_close(struct net_device *netdev) adapter->closing = true; disable_sub_crqs(adapter); - for (i = 0; i < adapter->req_rx_queues; i++) - napi_disable(&adapter->napi[i]); + if (adapter->napi) { + for (i = 0; i < adapter->req_rx_queues; i++) + napi_disable(&adapter->napi[i]); + } if (!adapter->failover) netif_tx_stop_all_queues(netdev); |