]> 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 eee1f19ef1e9397469e343133490ec6972b4bbdc..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;
 }