diff mbox

net/key/af_key.c: add missing kfree_skb

Message ID 1333960870-19735-1-git-send-email-Julia.Lawall@lip6.fr
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Julia Lawall April 9, 2012, 8:41 a.m. UTC
From: Julia Lawall <Julia.Lawall@lip6.fr>

At the point of this error-handling code, alloc_skb has succeded, so free
the resulting skb by jumping to the err label.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/key/af_key.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller April 13, 2012, 3:05 p.m. UTC | #1
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon,  9 Apr 2012 10:41:10 +0200

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> At the point of this error-handling code, alloc_skb has succeded, so free
> the resulting skb by jumping to the err label.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 11dbb22..7e5d927 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3480,7 +3480,7 @@  static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
 
 	/* Addresses to be used by KM for negotiation, if ext is available */
 	if (k != NULL && (set_sadb_kmaddress(skb, k) < 0))
-		return -EINVAL;
+		goto err;
 
 	/* selector src */
 	set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_SRC, sel);