]> git.baikalelectronics.ru Git - kernel.git/commit
[IPSEC]: Fix uninitialised dst warning in __xfrm_lookup
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 29 Nov 2007 13:50:31 +0000 (00:50 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 29 Nov 2007 13:50:31 +0000 (00:50 +1100)
commit95a48850222bc90678944d85806b5385df676a9b
treec14918fe21d01eeda770856aff55dc2363fd69a2
parent9b81ba7efa020731ed107a96b6562943a1e8d9b8
[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>
net/xfrm/xfrm_policy.c