* [PATCH] xfrm: potential uninitialized variable num_xfrms
@ 2010-04-28 7:20 Changli Gao
2010-04-28 16:41 ` David Miller
2010-04-30 23:40 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Changli Gao @ 2010-04-28 7:20 UTC (permalink / raw)
To: David S. Miller
Cc: Jamal Hadi Salim, Timo Teras, Herbert Xu, Alexey Dobriyan, netdev,
Changli Gao
potential uninitialized variable num_xfrms
fix compiler warning: 'num_xfrms' may be used uninitialized in this function.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/xfrm/xfrm_policy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 7430ac2..31f4ba4 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1732,7 +1732,7 @@ int __xfrm_lookup(struct net *net, struct dst_entry **dst_p, struct flowi *fl,
struct dst_entry *dst, *dst_orig = *dst_p, *route;
u16 family = dst_orig->ops->family;
u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT);
- int i, err, num_pols, num_xfrms, drop_pols = 0;
+ int i, err, num_pols, num_xfrms = 0, drop_pols = 0;
restart:
dst = NULL;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfrm: potential uninitialized variable num_xfrms
2010-04-28 7:20 [PATCH] xfrm: potential uninitialized variable num_xfrms Changli Gao
@ 2010-04-28 16:41 ` David Miller
2010-04-30 23:40 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2010-04-28 16:41 UTC (permalink / raw)
To: xiaosuo; +Cc: hadi, timo.teras, herbert, adobriyan, netdev
From: Changli Gao <xiaosuo@gmail.com>
Date: Wed, 28 Apr 2010 15:20:22 +0800
> potential uninitialized variable num_xfrms
>
> fix compiler warning: 'num_xfrms' may be used uninitialized in this function.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
We've all been seeing it for weeks too, but I honestly have
reservations about trying to simply pacify the compiler here.
The num_xfrms variable is only used in code paths that actually
initialize it's value. The compiler just can't see this in the
control flow.
Check it if you don't believe me.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfrm: potential uninitialized variable num_xfrms
2010-04-28 7:20 [PATCH] xfrm: potential uninitialized variable num_xfrms Changli Gao
2010-04-28 16:41 ` David Miller
@ 2010-04-30 23:40 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2010-04-30 23:40 UTC (permalink / raw)
To: xiaosuo; +Cc: hadi, timo.teras, herbert, adobriyan, netdev
From: Changli Gao <xiaosuo@gmail.com>
Date: Wed, 28 Apr 2010 15:20:22 +0800
> potential uninitialized variable num_xfrms
>
> fix compiler warning: 'num_xfrms' may be used uninitialized in this function.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
I decided to apply this after all, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-30 23:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-28 7:20 [PATCH] xfrm: potential uninitialized variable num_xfrms Changli Gao
2010-04-28 16:41 ` David Miller
2010-04-30 23:40 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).