diff options
author | 2025-03-12 08:22:47 +0000 | |
---|---|---|
committer | 2025-03-18 13:18:36 +0100 | |
commit | ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b (patch) | |
tree | 9cba351968ad775449b48104114ea678c7cf9849 /net/ipv6/reassembly.c | |
parent | net: skbuff: Remove unused skb_add_data() (diff) | |
download | wireguard-linux-ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b.tar.xz wireguard-linux-ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b.zip |
inet: frags: add inet_frag_putn() helper
inet_frag_putn() can release multiple references
in one step.
Use it in inet_frags_free_cb().
Replace inet_frag_put(X) with inet_frag_putn(X, 1)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250312082250.1803501-2-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index a48be617a8ab..5d56a8e5166b 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -380,7 +380,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) fq = fq_find(net, fhdr->identification, hdr, iif); if (fq) { u32 prob_offset = 0; - int ret; + int ret, refs = 1; spin_lock(&fq->q.lock); @@ -389,7 +389,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) &prob_offset); spin_unlock(&fq->q.lock); - inet_frag_put(&fq->q); + inet_frag_putn(&fq->q, refs); if (prob_offset) { __IP6_INC_STATS(net, __in6_dev_get_safely(skb->dev), IPSTATS_MIB_INHDRERRORS); |