Skip to content

Commit 6c628ed

Browse files
Yue Haibingkuba-moo
authored andcommitted
ipv6: mcast: Simplify mld_clear_{report|query}()
Use __skb_queue_purge() instead of re-implementing it. Note that it uses kfree_skb_reason() instead of kfree_skb() internally, and pass SKB_DROP_REASON_QUEUE_PURGE drop reason to the kfree_skb tracepoint. Signed-off-by: Yue Haibing <[email protected]> Reviewed-by: Hangbin Liu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 47ee43e commit 6c628ed

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

net/ipv6/mcast.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -845,21 +845,15 @@ static void mld_clear_delrec(struct inet6_dev *idev)
845845

846846
static void mld_clear_query(struct inet6_dev *idev)
847847
{
848-
struct sk_buff *skb;
849-
850848
spin_lock_bh(&idev->mc_query_lock);
851-
while ((skb = __skb_dequeue(&idev->mc_query_queue)))
852-
kfree_skb(skb);
849+
__skb_queue_purge(&idev->mc_query_queue);
853850
spin_unlock_bh(&idev->mc_query_lock);
854851
}
855852

856853
static void mld_clear_report(struct inet6_dev *idev)
857854
{
858-
struct sk_buff *skb;
859-
860855
spin_lock_bh(&idev->mc_report_lock);
861-
while ((skb = __skb_dequeue(&idev->mc_report_queue)))
862-
kfree_skb(skb);
856+
__skb_queue_purge(&idev->mc_report_queue);
863857
spin_unlock_bh(&idev->mc_report_lock);
864858
}
865859

0 commit comments

Comments
 (0)