aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_fragment.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2025-03-12 08:22:47 +0000
committerPaolo Abeni <[email protected]>2025-03-18 12:18:36 +0000
commitae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b (patch)
tree9cba351968ad775449b48104114ea678c7cf9849 /net/ipv4/inet_fragment.c
parentnet: skbuff: Remove unused skb_add_data() (diff)
downloadkernel-ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b.tar.gz
kernel-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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/ipv4/inet_fragment.c')
-rw-r--r--net/ipv4/inet_fragment.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index d179a2c84222..efc4cbee04c2 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -145,8 +145,7 @@ static void inet_frags_free_cb(void *ptr, void *arg)
}
spin_unlock_bh(&fq->lock);
- if (refcount_sub_and_test(count, &fq->refcnt))
- inet_frag_destroy(fq);
+ inet_frag_putn(fq, count);
}
static LLIST_HEAD(fqdir_free_list);