summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorHerbert Xu2007-10-09 22:33:35 +0200
committerDavid S. Miller2007-10-11 01:55:03 +0200
commitb7c6538cd84f8072fad43bfce530f5bf695edbba (patch)
treee0ba79ffe7b79355985a45de9961b17a0462764f /net/xfrm/xfrm_output.c
parent[IPSEC]: Lock state when copying non-atomic fields to user-space (diff)
downloadkernel-qcow2-linux-b7c6538cd84f8072fad43bfce530f5bf695edbba.tar.gz
kernel-qcow2-linux-b7c6538cd84f8072fad43bfce530f5bf695edbba.tar.xz
kernel-qcow2-linux-b7c6538cd84f8072fad43bfce530f5bf695edbba.zip
[IPSEC]: Move state lock into x->type->output
This patch releases the lock on the state before calling x->type->output. It also adds the lock to the spots where they're currently needed. Most of those places (all except mip6) are expected to disappear with async crypto. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 9847baec4094..0eb3377602e9 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -67,15 +67,15 @@ int xfrm_output(struct sk_buff *skb)
if (err)
goto error;
- err = x->type->output(x, skb);
- if (err)
- goto error;
-
x->curlft.bytes += skb->len;
x->curlft.packets++;
spin_unlock_bh(&x->lock);
+ err = x->type->output(x, skb);
+ if (err)
+ goto error_nolock;
+
if (!(skb->dst = dst_pop(dst))) {
err = -EHOSTUNREACH;
goto error_nolock;