Skip to content

Commit

Permalink
ibmvnic: Validate napi exist before disabling them
Browse files Browse the repository at this point in the history
Validate that the napi structs exist before trying to disable them
at driver close.

Signed-off-by: Nathan Fontenot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
nfont authored and davem330 committed Apr 24, 2017
1 parent 53da09e commit 3ca1993
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ca1993

Please sign in to comment.