Skip to content

Commit

Permalink
[PKTGEN]: Fix double unlock of xfrm_state->lock
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 20, 2007
1 parent 9055fa1 commit 1f8170b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f8170b

Please sign in to comment.