diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-24 01:47:00 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-24 13:28:27 -0700 |
commit | 9a127aad4d60968fba96622008ea0d243688f2b0 (patch) | |
tree | ab6df3df50405736b7f51b941da6c4d0b368a847 /net/key | |
parent | 03e6d819c2cb2cc8ce5642669a0a7c72336ee7a2 (diff) | |
download | kernel_samsung_tuna-9a127aad4d60968fba96622008ea0d243688f2b0.zip kernel_samsung_tuna-9a127aad4d60968fba96622008ea0d243688f2b0.tar.gz kernel_samsung_tuna-9a127aad4d60968fba96622008ea0d243688f2b0.tar.bz2 |
af_key: return error if pfkey_xfrm_policy2msg_prep() fails
The original code saved the error value but just returned 0 in the end.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/key')
-rw-r--r-- | net/key/af_key.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 3687078..344145f 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -2129,10 +2129,9 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c int err; out_skb = pfkey_xfrm_policy2msg_prep(xp); - if (IS_ERR(out_skb)) { - err = PTR_ERR(out_skb); - goto out; - } + if (IS_ERR(out_skb)) + return PTR_ERR(out_skb); + err = pfkey_xfrm_policy2msg(out_skb, xp, dir); if (err < 0) return err; @@ -2148,7 +2147,6 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c out_hdr->sadb_msg_seq = c->seq; out_hdr->sadb_msg_pid = c->pid; pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); -out: return 0; } |