hv_netvsc: init completion during alloc
authorStephen Hemminger <sthemmin@microsoft.com>
Tue, 23 Aug 2016 19:17:51 +0000 (12:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 19:05:37 +0000 (12:05 -0700)
Move initialization to allocate where other fields are initialized.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index 2ece27a..27eb507 100644 (file)
@@ -164,6 +164,7 @@ static struct netvsc_device *alloc_net_device(void)
        atomic_set(&net_device->open_cnt, 0);
        net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT;
        net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT;
+       init_completion(&net_device->channel_init_wait);
 
        return net_device;
 }
@@ -1442,9 +1443,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 
        net_device->ring_size = ring_size;
 
-       /* Initialize the NetVSC channel extension */
-       init_completion(&net_device->channel_init_wait);
-
        set_per_channel_state(device->channel, net_device->cb_buffer);
 
        /* Open the channel */