summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-24 01:47:00 +0000
committerDavid S. Miller <davem@davemloft.net>2010-03-24 13:28:27 -0700
commit9a127aad4d60968fba96622008ea0d243688f2b0 (patch)
treeab6df3df50405736b7f51b941da6c4d0b368a847
parent03e6d819c2cb2cc8ce5642669a0a7c72336ee7a2 (diff)
downloadop-kernel-dev-9a127aad4d60968fba96622008ea0d243688f2b0.zip
op-kernel-dev-9a127aad4d60968fba96622008ea0d243688f2b0.tar.gz
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>
-rw-r--r--net/key/af_key.c8
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;
}
OpenPOWER on IntegriCloud