ibmvnic: Move initialization of the stats token to ibmvnic_open
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Fri, 21 Apr 2017 19:38:58 +0000 (15:38 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Apr 2017 16:52:13 +0000 (12:52 -0400)
We should be initializing the stats token in the same place we
initialize the other resources for the driver.

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 cc34bf9be4051df640d441787d741bd0c54c15ac..199cccbb577a1e32a19a60f49a7dce85a7540608 100644 (file)
@@ -607,6 +607,10 @@ static int ibmvnic_open(struct net_device *netdev)
                return -1;
        }
 
+       rc = init_stats_token(adapter);
+       if (rc)
+               return rc;
+
        adapter->map_id = 1;
        adapter->napi = kcalloc(adapter->req_rx_queues,
                                sizeof(struct napi_struct), GFP_KERNEL);
@@ -3241,12 +3245,6 @@ static int ibmvnic_init(struct ibmvnic_adapter *adapter)
                return rc;
        }
 
-       rc = init_stats_token(adapter);
-       if (rc) {
-               release_crq_queue(adapter);
-               return rc;
-       }
-
        init_completion(&adapter->init_done);
        ibmvnic_send_crq_init(adapter);
        if (!wait_for_completion_timeout(&adapter->init_done, timeout)) {