Skip to content

Commit c69b359

Browse files
edumazetgregkh
authored andcommitted
ipv4: frags: remove ipq_put()
[ Upstream commit a2fb987 ] Replace ipq_put() with inet_frag_putn() Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250312082250.1803501-3-edumazet@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Stable-dep-of: 653d7dd ("inet: frags: publish queues before arming timer") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4d40d90 commit c69b359

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

net/ipv4/ip_fragment.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,6 @@ static void ip4_frag_free(struct inet_frag_queue *q)
107107
inet_putpeer(qp->peer);
108108
}
109109

110-
111-
/* Destruction primitives. */
112-
113-
static void ipq_put(struct ipq *ipq)
114-
{
115-
inet_frag_putn(&ipq->q, 1);
116-
}
117-
118110
/* Kill ipq entry. It is not destroyed immediately,
119111
* because caller (and someone more) holds reference count.
120112
*/
@@ -142,6 +134,7 @@ static void ip_expire(struct timer_list *t)
142134
struct sk_buff *head = NULL;
143135
struct net *net;
144136
struct ipq *qp;
137+
int refs = 1;
145138
int err;
146139

147140
qp = container_of(frag, struct ipq, q);
@@ -203,7 +196,7 @@ static void ip_expire(struct timer_list *t)
203196
out_rcu_unlock:
204197
rcu_read_unlock();
205198
kfree_skb_reason(head, SKB_DROP_REASON_FRAG_REASM_TIMEOUT);
206-
ipq_put(qp);
199+
inet_frag_putn(&qp->q, refs);
207200
}
208201

209202
/* Find the correct entry in the "incomplete datagrams" queue for
@@ -492,14 +485,14 @@ int ip_defrag(struct net *net, struct sk_buff *skb, u32 user)
492485
/* Lookup (or create) queue header */
493486
qp = ip_find(net, ip_hdr(skb), user, vif);
494487
if (qp) {
495-
int ret;
488+
int ret, refs = 1;
496489

497490
spin_lock(&qp->q.lock);
498491

499492
ret = ip_frag_queue(qp, skb);
500493

501494
spin_unlock(&qp->q.lock);
502-
ipq_put(qp);
495+
inet_frag_putn(&qp->q, refs);
503496
return ret;
504497
}
505498

0 commit comments

Comments
 (0)