The following commit has been merged in the merge/master branch: commit 94b1a3f11841e890e6e1ca36e37ddeebb49b00a5 Merge: 439030821e5db7241857e3eaebb4263562e5c615 289e386bcec0d469fc629019b349f47d17789911 Author: Marek Lindner mareklindner@neomailbox.ch Date: Mon Apr 11 18:51:30 2016 +0800
Merge branch 'next'
diff --combined net/batman-adv/send.c index 2e8433b,7641785..f2f1256 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@@ -26,7 -26,6 +26,7 @@@ #include <linux/if.h> #include <linux/jiffies.h> #include <linux/kernel.h> +#include <linux/kref.h> #include <linux/list.h> #include <linux/netdevice.h> #include <linux/printk.h> @@@ -553,7 -552,7 +553,7 @@@ static void batadv_send_outstanding_bca struct net_device *soft_iface; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); forw_packet = container_of(delayed_work, struct batadv_forw_packet, delayed_work); soft_iface = forw_packet->if_incoming->soft_iface; @@@ -578,15 -577,10 +578,15 @@@ if (forw_packet->num_packets >= hard_iface->num_bcasts) continue;
+ if (!kref_get_unless_zero(&hard_iface->refcount)) + continue; + /* send a copy of the saved skb */ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); if (skb1) batadv_send_broadcast_skb(skb1, hard_iface); + + batadv_hardif_put(hard_iface); } rcu_read_unlock();
@@@ -610,7 -604,7 +610,7 @@@ void batadv_send_outstanding_bat_ogm_pa struct batadv_forw_packet *forw_packet; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); forw_packet = container_of(delayed_work, struct batadv_forw_packet, delayed_work); bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); @@@ -681,6 -675,9 +681,9 @@@ batadv_purge_outstanding_packets(struc
if (pending) { hlist_del(&forw_packet->list); + if (!forw_packet->own) + atomic_inc(&bat_priv->bcast_queue_left); + batadv_forw_packet_free(forw_packet); } } @@@ -708,6 -705,9 +711,9 @@@
if (pending) { hlist_del(&forw_packet->list); + if (!forw_packet->own) + atomic_inc(&bat_priv->batman_queue_left); + batadv_forw_packet_free(forw_packet); } }