Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194650
b: refs/heads/master
c: 93bb64e
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 4, 2010
1 parent ef670a9 commit 69f8c06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5460618405eec8c3300947a499011528a115acd
refs/heads/master: 93bb64eac10aad3dae6178d7da94765f207d121f
9 changes: 7 additions & 2 deletions trunk/net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,18 @@ EXPORT_SYMBOL(skb_free_datagram);

void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb)
{
if (likely(atomic_read(&skb->users) == 1))
smp_rmb();
else if (likely(!atomic_dec_and_test(&skb->users)))
return;

lock_sock_bh(sk);
skb_orphan(skb);
sk_mem_reclaim_partial(sk);
unlock_sock_bh(sk);

/* skb is now orphaned, might be freed outside of locked section */
consume_skb(skb);
/* skb is now orphaned, can be freed outside of locked section */
__kfree_skb(skb);
}
EXPORT_SYMBOL(skb_free_datagram_locked);

Expand Down

0 comments on commit 69f8c06

Please sign in to comment.