netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request (net-next): ipsec-next 2017-04-28
@ 2017-04-28  8:42 Steffen Klassert
  2017-04-28  8:42 ` [PATCH] esp: Fix misplaced spin_unlock_bh Steffen Klassert
  2017-04-28 19:44 ` pull request (net-next): ipsec-next 2017-04-28 David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Steffen Klassert @ 2017-04-28  8:42 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev

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

Please pull or let me know if there are problems.

Thanks!

The following changes since commit e2989ee9746b3f2e78d1a39bbc402d884e8b8bf1:

  bpf, doc: update list of architectures that do eBPF JIT (2017-04-23 15:56:48 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master

for you to fetch changes up to e892d2d40445a14a19530a2be8c489b87bcd7c19:

  esp: Fix misplaced spin_unlock_bh. (2017-04-24 07:56:31 +0200)

----------------------------------------------------------------
Steffen Klassert (1):
      esp: Fix misplaced spin_unlock_bh.

 net/ipv4/esp4.c | 6 +-----
 net/ipv6/esp6.c | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

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

* [PATCH] esp: Fix misplaced spin_unlock_bh.
  2017-04-28  8:42 pull request (net-next): ipsec-next 2017-04-28 Steffen Klassert
@ 2017-04-28  8:42 ` Steffen Klassert
  2017-04-28 19:44 ` pull request (net-next): ipsec-next 2017-04-28 David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Steffen Klassert @ 2017-04-28  8:42 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev

A recent commit moved esp_alloc_tmp() out of a lock
protected region, but forgot to remove the unlock from
the error path. This patch removes the forgotten unlock.
While at it, remove some unneeded error assignments too.

Fixes: fca11ebde3f0 ("esp4: Reorganize esp_output")
Fixes: 383d0350f2cc ("esp6: Reorganize esp_output")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/esp4.c | 6 +-----
 net/ipv6/esp6.c | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 7e501ad..7f2caf7 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -356,11 +356,8 @@ int esp_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, extralen);
-	if (!tmp) {
-		spin_unlock_bh(&x->lock);
-		err = -ENOMEM;
+	if (!tmp)
 		goto error;
-	}
 
 	extra = esp_tmp_extra(tmp);
 	iv = esp_tmp_iv(aead, tmp, extralen);
@@ -389,7 +386,6 @@ int esp_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;
 		}
 
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 8b55abf..1fe99ba 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;
 		}
 
-- 
2.7.4

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

* Re: pull request (net-next): ipsec-next 2017-04-28
  2017-04-28  8:42 pull request (net-next): ipsec-next 2017-04-28 Steffen Klassert
  2017-04-28  8:42 ` [PATCH] esp: Fix misplaced spin_unlock_bh Steffen Klassert
@ 2017-04-28 19:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-04-28 19:44 UTC (permalink / raw)
  To: steffen.klassert; +Cc: herbert, netdev

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Fri, 28 Apr 2017 10:42:37 +0200

> Just one patch to fix a misplaced spin_unlock_bh in an error path.
> 
> Please pull or let me know if there are problems.


Pulled, thank you.

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

end of thread, other threads:[~2017-04-28 19:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28  8:42 pull request (net-next): ipsec-next 2017-04-28 Steffen Klassert
2017-04-28  8:42 ` [PATCH] esp: Fix misplaced spin_unlock_bh Steffen Klassert
2017-04-28 19:44 ` pull request (net-next): ipsec-next 2017-04-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).