diff options
author | Eric Dumazet <edumazet@google.com> | 2025-03-12 08:22:47 +0000 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-03-18 13:18:36 +0100 |
commit | ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b (patch) | |
tree | 9cba351968ad775449b48104114ea678c7cf9849 /net/ipv4/inet_fragment.c | |
parent | 24faa63bcea88b6f24b0a3a710708505a876f9ba (diff) |
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/ipv4/inet_fragment.c')
-rw-r--r-- | net/ipv4/inet_fragment.c | 3 |
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); |