]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: should explicitely initialize atomic_t field in struct dst_ops
authorEric Dumazet <dada1@cosmosbay.com>
Thu, 31 Jan 2008 04:07:45 +0000 (20:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2008 03:27:23 +0000 (19:27 -0800)
All but one struct dst_ops static initializations miss explicit
initialization of entries field.

As this field is atomic_t, we should use ATOMIC_INIT(0), and not
rely on atomic_t implementation.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c
net/ipv4/xfrm4_policy.c
net/ipv6/route.c
net/ipv6/xfrm6_policy.c

index 896c768e41a2d90baef4b4a3783be0164678ff9e..163086b2f0584cc9a0d06e4af87144d31ceb562d 100644 (file)
@@ -169,6 +169,7 @@ static struct dst_ops ipv4_dst_ops = {
        .update_pmtu =          ip_rt_update_pmtu,
        .local_out =            ip_local_out,
        .entry_size =           sizeof(struct rtable),
+       .entries =              ATOMIC_INIT(0),
 };
 
 #define ECN_OR_COST(class)     TC_PRIO_##class
@@ -2498,6 +2499,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
        .check                  =       ipv4_dst_check,
        .update_pmtu            =       ipv4_rt_blackhole_update_pmtu,
        .entry_size             =       sizeof(struct rtable),
+       .entries                =       ATOMIC_INIT(0),
 };
 
 
index 3783e3ee56a424f185beb18c38a7cf00cb11c24f..10ed70491434fe9240445ae71cff6c46259e9d74 100644 (file)
@@ -247,6 +247,7 @@ static struct dst_ops xfrm4_dst_ops = {
        .local_out =            __ip_local_out,
        .gc_thresh =            1024,
        .entry_size =           sizeof(struct xfrm_dst),
+       .entries =              ATOMIC_INIT(0),
 };
 
 static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
index 162cb66d460502791ceb8aee658902295bd7faac..bf6b6652ab7927cae8a45249e0245962a33bfd56 100644 (file)
@@ -107,6 +107,7 @@ static struct dst_ops ip6_dst_ops = {
        .update_pmtu            =       ip6_rt_update_pmtu,
        .local_out              =       ip6_local_out,
        .entry_size             =       sizeof(struct rt6_info),
+       .entries                =       ATOMIC_INIT(0),
 };
 
 static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
@@ -120,6 +121,7 @@ static struct dst_ops ip6_dst_blackhole_ops = {
        .check                  =       ip6_dst_check,
        .update_pmtu            =       ip6_rt_blackhole_update_pmtu,
        .entry_size             =       sizeof(struct rt6_info),
+       .entries                =       ATOMIC_INIT(0),
 };
 
 struct rt6_info ip6_null_entry = {
index c25a6b527fc4e083184e718720f184a752625bc6..7d20199ee1f39cb98c4622042fe9460e4dbd42a7 100644 (file)
@@ -272,6 +272,7 @@ static struct dst_ops xfrm6_dst_ops = {
        .local_out =            __ip6_local_out,
        .gc_thresh =            1024,
        .entry_size =           sizeof(struct xfrm_dst),
+       .entries =              ATOMIC_INIT(0),
 };
 
 static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {