ibmvnic: Delete napi's when releasing driver resources
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Wed, 3 May 2017 18:04:44 +0000 (14:04 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 May 2017 15:33:04 +0000 (11:33 -0400)
The napi structs allocated at drivier initializatio need to be
free'ed when releasing the drivers resources.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index a7c7a94c9d63846827f6f667aa8637bf9254bbaf..d52d98cf931742383f6421c2ecdc12cb2d0613a8 100644 (file)
@@ -552,11 +552,20 @@ static int ibmvnic_login(struct net_device *netdev)
 
 static void release_resources(struct ibmvnic_adapter *adapter)
 {
+       int i;
+
        release_tx_pools(adapter);
        release_rx_pools(adapter);
 
        release_stats_token(adapter);
        release_error_buffers(adapter);
+
+       if (adapter->napi) {
+               for (i = 0; i < adapter->req_rx_queues; i++) {
+                       if (&adapter->napi[i])
+                               netif_napi_del(&adapter->napi[i]);
+               }
+       }
 }
 
 static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state)