kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] af_key: return error if pfkey_xfrm_policy2msg_prep() fails
@ 2010-03-24 11:47 Dan Carpenter
  2010-03-24 13:46 ` [patch] af_key: return error if pfkey_xfrm_policy2msg_prep() jamal
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2010-03-24 11:47 UTC (permalink / raw)
  To: netdev
  Cc: Jamal Hadi Salim, David S. Miller, Eric Dumazet,
	Stephen Hemminger, Alexey Dobriyan, kernel-janitors

The original code saved the error value but just returned 0 in the end.

Signed-off-by: Dan Carpenter <error27@gmail.com>

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;
 
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-24 20:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 11:47 [patch] af_key: return error if pfkey_xfrm_policy2msg_prep() fails Dan Carpenter
2010-03-24 13:46 ` [patch] af_key: return error if pfkey_xfrm_policy2msg_prep() jamal
2010-03-24 16:19   ` Dan Carpenter
2010-03-24 16:39     ` jamal
2010-03-24 20:28       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).