summary refs log tree commit diff
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-04-28 15:43:24 -0400
committerDavid S. Miller <davem@davemloft.net>2017-04-28 15:43:24 -0400
commitcd5487fb9485934dfa0ad9d6b52c4da8e38318e6 (patch)
tree9effb1cffdea1f8d6ec276550a398e36a2153ac8 /net/ipv6
parentcec381919818a9a0cb85600b3c82404bdd38cf36 (diff)
parente892d2d40445a14a19530a2be8c489b87bcd7c19 (diff)
downloadlinux-cd5487fb9485934dfa0ad9d6b52c4da8e38318e6.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2017-04-28

Just one patch to fix a misplaced spin_unlock_bh in an error path.

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/esp6.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 8b55abf1c45b..1fe99ba8066c 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -330,11 +330,8 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
 	ivlen = crypto_aead_ivsize(aead);
 
 	tmp = esp_alloc_tmp(aead, esp->nfrags + 2, seqhilen);
-	if (!tmp) {
-		spin_unlock_bh(&x->lock);
-		err = -ENOMEM;
+	if (!tmp)
 		goto error;
-	}
 
 	seqhi = esp_tmp_seqhi(tmp);
 	iv = esp_tmp_iv(aead, tmp, seqhilen);
@@ -362,7 +359,6 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
 		spin_lock_bh(&x->lock);
 		if (unlikely(!skb_page_frag_refill(allocsize, pfrag, GFP_ATOMIC))) {
 			spin_unlock_bh(&x->lock);
-			err = -ENOMEM;
 			goto error;
 		}