Skip to content

Commit cd5487f

Browse files
committed
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 <[email protected]>
2 parents cec3819 + e892d2d commit cd5487f

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

net/ipv4/esp4.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,8 @@ int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *
356356
ivlen = crypto_aead_ivsize(aead);
357357

358358
tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen);
359-
if (!tmp) {
360-
spin_unlock_bh(&x->lock);
361-
err = -ENOMEM;
359+
if (!tmp)
362360
goto error;
363-
}
364361

365362
extra = esp_tmp_extra(tmp);
366363
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 *
389386
spin_lock_bh(&x->lock);
390387
if (unlikely(!skb_page_frag_refill(allocsize, pfrag, GFP_ATOMIC))) {
391388
spin_unlock_bh(&x->lock);
392-
err = -ENOMEM;
393389
goto error;
394390
}
395391

net/ipv6/esp6.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,8 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
330330
ivlen = crypto_aead_ivsize(aead);
331331

332332
tmp = esp_alloc_tmp(aead, esp->nfrags + 2, seqhilen);
333-
if (!tmp) {
334-
spin_unlock_bh(&x->lock);
335-
err = -ENOMEM;
333+
if (!tmp)
336334
goto error;
337-
}
338335

339336
seqhi = esp_tmp_seqhi(tmp);
340337
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
362359
spin_lock_bh(&x->lock);
363360
if (unlikely(!skb_page_frag_refill(allocsize, pfrag, GFP_ATOMIC))) {
364361
spin_unlock_bh(&x->lock);
365-
err = -ENOMEM;
366362
goto error;
367363
}
368364

0 commit comments

Comments
 (0)