]> Pileus Git - ~andy/linux/blobdiff - drivers/net/veth.c
net: Explicitly initialize u64_stats_sync structures for lockdep
[~andy/linux] / drivers / net / veth.c
index da866523cf20097d57550c7357020e937782fd37..46e83e3fe999fe4a5f8673f1a530936bf568ec2b 100644 (file)
@@ -230,10 +230,18 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)
 
 static int veth_dev_init(struct net_device *dev)
 {
+       int i;
+
        dev->vstats = alloc_percpu(struct pcpu_vstats);
        if (!dev->vstats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct pcpu_vstats *veth_stats;
+               veth_stats = per_cpu_ptr(dev->vstats, i);
+               u64_stats_init(&veth_stats->syncp);
+       }
+
        return 0;
 }
 
@@ -269,6 +277,7 @@ static void veth_setup(struct net_device *dev)
        dev->ethtool_ops = &veth_ethtool_ops;
        dev->features |= NETIF_F_LLTX;
        dev->features |= VETH_FEATURES;
+       dev->vlan_features = dev->features;
        dev->destructor = veth_dev_free;
 
        dev->hw_features = VETH_FEATURES;