aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-29 08:50:31 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-11-29 08:50:31 -0500
commit5e5234ff17ef98932688116025b30958bd28a940 (patch)
treec14918fe21d01eeda770856aff55dc2363fd69a2 /net/xfrm/xfrm_policy.c
parent076931989fe96823a577259cc6bc205d7ec31754 (diff)
[IPSEC]: Fix uninitialised dst warning in __xfrm_lookup
Andrew Morton reported that __xfrm_lookup generates this warning: net/xfrm/xfrm_policy.c: In function '__xfrm_lookup': net/xfrm/xfrm_policy.c:1449: warning: 'dst' may be used uninitialized in this function This is because if policy->action is of an unexpected value then dst will not be initialised. Of course, in practice this should never happen since the input layer xfrm_user/af_key will filter out all illegal values. But the compiler doesn't know that of course. So this patch fixes this by taking the conservative approach and treat all unknown actions the same as a blocking action. Thanks to Andrew for finding this and providing an initial fix. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b702bd8a3893..9a4cf2e45a15 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1344,6 +1344,7 @@ restart:
1344 xfrm_nr += pols[0]->xfrm_nr; 1344 xfrm_nr += pols[0]->xfrm_nr;
1345 1345
1346 switch (policy->action) { 1346 switch (policy->action) {
1347 default:
1347 case XFRM_POLICY_BLOCK: 1348 case XFRM_POLICY_BLOCK:
1348 /* Prohibit the flow */ 1349 /* Prohibit the flow */
1349 err = -EPERM; 1350 err = -EPERM;