netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][PKTGEN] Fix double unlock of xfrm_state->lock
@ 2007-11-19  9:47 Pavel Emelyanov
  2007-11-19 16:18 ` jamal
  2007-11-20  6:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-19  9:47 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

The pktgen_output_ipsec() function can unlock this lock twice
due to merged error and plain paths. Remove one of the calls
to spin_unlock.

Other possible solution would be to place "return 0" right 
after the first unlock, but at this place the err is known 
to be 0, so these solutions are the same except for this one
makes the code shorter.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index de33f36..285ec3e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2463,8 +2463,6 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev)
 
 	x->curlft.bytes +=skb->len;
 	x->curlft.packets++;
-	spin_unlock(&x->lock);
-
 error:
 	spin_unlock(&x->lock);
 	return err;

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

end of thread, other threads:[~2007-11-20  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19  9:47 [PATCH][PKTGEN] Fix double unlock of xfrm_state->lock Pavel Emelyanov
2007-11-19 16:18 ` jamal
2007-11-20  6:51 ` 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).