From b7c6538cd84f8072fad43bfce530f5bf695edbba Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 9 Oct 2007 13:33:35 -0700 Subject: [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 Signed-off-by: David S. Miller --- net/xfrm/xfrm_output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/xfrm/xfrm_output.c') diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 9847baec409..0eb3377602e 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; -- cgit v1.2.3