Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2422970 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

[NET]: should explicitely initialize atomic_t field in struct dst_ops



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: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad1984e8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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),
};


+1 −0
Original line number Diff line number Diff line
@@ -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 = {
+2 −0
Original line number Diff line number Diff line
@@ -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 = {
+1 −0
Original line number Diff line number Diff line
@@ -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 = {