Currently the kernel warns about:
net/key/af_key.c: In function 'pfkey_spddelete':
net/key/af_key.c:2359: warning: 'pol_ctx' may be used uninitialized in this function

Certainly in the case that CONFIG_SECURITY_NETWORK_XFRM is not set a bogus
value for pol_ctx will be passed arround. Unconditonnaly initialise to NULL,
to avoid this problem.

Signed-off-by: Tony Breeds
---
net/key/af_key.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 81a8e52..48923e0 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2385,6 +2385,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
if (sel.dport)
sel.dport_mask = htons(0xffff);

+ pol_ctx = NULL;
sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
@@ -2396,8 +2397,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
kfree(uctx);
if (err)
return err;
- } else
- pol_ctx = NULL;
+ }

xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN,
pol->sadb_x_policy_dir - 1, &sel, pol_ctx,
--
1.5.5.1


Yours Tony

linux.conf.au http://www.marchsouth.org/
Jan 19 - 24 2009 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/