diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 304602784c3b78249c73609e8aad9cbc55e70e66..c4d2c1f824bb217d25091a66e23c568c60053fb2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -817,10 +817,9 @@ void napi_consume_skb(struct sk_buff *skb, int budget) return; } - if (likely(atomic_read(&skb->users) == 1)) - smp_rmb(); - else if (likely(!atomic_dec_and_test(&skb->users))) + if (!skb_unref(skb)) return; + /* if reaching here SKB is ready to free */ trace_consume_skb(skb);