batman-adv: Simplify 'batadv_v_ogm_aggr_list_free()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 31 Oct 2019 07:42:55 +0000 (08:42 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sun, 3 Nov 2019 07:30:58 +0000 (08:30 +0100)
Use 'skb_queue_purge()' instead of re-implementing it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/bat_v_ogm.c

index 8033f24f506cae2d734aea5296cb5bd3066e7277..76b732e2f31c6f9622661e36df56752e494f00f8 100644 (file)
@@ -178,13 +178,9 @@ static bool batadv_v_ogm_queue_left(struct sk_buff *skb,
  */
 static void batadv_v_ogm_aggr_list_free(struct batadv_hard_iface *hard_iface)
 {
-       struct sk_buff *skb;
-
        lockdep_assert_held(&hard_iface->bat_v.aggr_list_lock);
 
-       while ((skb = skb_dequeue(&hard_iface->bat_v.aggr_list)))
-               kfree_skb(skb);
-
+       skb_queue_purge(&hard_iface->bat_v.aggr_list);
        hard_iface->bat_v.aggr_len = 0;
 }