]> Pileus Git - ~andy/linux/blobdiff - net/ipv6/ip6_gre.c
net: Explicitly initialize u64_stats_sync structures for lockdep
[~andy/linux] / net / ipv6 / ip6_gre.c
index bf4a9a084de5aa8f733318276d6e84cc37d5e249..8acb28621f9cfd57071eeff1a39acd0de1ff6c02 100644 (file)
@@ -1252,6 +1252,7 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
 static int ip6gre_tunnel_init(struct net_device *dev)
 {
        struct ip6_tnl *tunnel;
+       int i;
 
        tunnel = netdev_priv(dev);
 
@@ -1269,6 +1270,13 @@ static int ip6gre_tunnel_init(struct net_device *dev)
        if (!dev->tstats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct pcpu_tstats *ip6gre_tunnel_stats;
+               ip6gre_tunnel_stats = per_cpu_ptr(dev->tstats, i);
+               u64_stats_init(&ip6gre_tunnel_stats->syncp);
+       }
+
+
        return 0;
 }
 
@@ -1449,6 +1457,7 @@ static void ip6gre_netlink_parms(struct nlattr *data[],
 static int ip6gre_tap_init(struct net_device *dev)
 {
        struct ip6_tnl *tunnel;
+       int i;
 
        tunnel = netdev_priv(dev);
 
@@ -1462,6 +1471,12 @@ static int ip6gre_tap_init(struct net_device *dev)
        if (!dev->tstats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct pcpu_tstats *ip6gre_tap_stats;
+               ip6gre_tap_stats = per_cpu_ptr(dev->tstats, i);
+               u64_stats_init(&ip6gre_tap_stats->syncp);
+       }
+
        return 0;
 }