]> Pileus Git - ~andy/linux/blobdiff - drivers/net/macvlan.c
net: Explicitly initialize u64_stats_sync structures for lockdep
[~andy/linux] / drivers / net / macvlan.c
index 9bf46bd19b87bf947fd79e547bdde626c8a12097..0924e51b9ee0080ce294a859b91e2d8600c9ab15 100644 (file)
@@ -501,6 +501,7 @@ static int macvlan_init(struct net_device *dev)
 {
        struct macvlan_dev *vlan = netdev_priv(dev);
        const struct net_device *lowerdev = vlan->lowerdev;
+       int i;
 
        dev->state              = (dev->state & ~MACVLAN_STATE_MASK) |
                                  (lowerdev->state & MACVLAN_STATE_MASK);
@@ -516,6 +517,12 @@ static int macvlan_init(struct net_device *dev)
        if (!vlan->pcpu_stats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct macvlan_pcpu_stats *mvlstats;
+               mvlstats = per_cpu_ptr(vlan->pcpu_stats, i);
+               u64_stats_init(&mvlstats->syncp);
+       }
+
        return 0;
 }