Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af0a171c authored by Marek Lindner's avatar Marek Lindner Committed by Antonio Quartulli
Browse files

batman-adv: fix NULL pointer dereferences



Was introduced with 4c8755d6
("batman-adv: Send multicast packets to nodes with a WANT_ALL flag")

Reported-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Acked-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarLinus Lüssing <linus.luessing@web.de>
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
parent 554215c5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ batadv_mcast_forw_ipv4_node_get(struct batadv_priv *bat_priv)
	hlist_for_each_entry_rcu(tmp_orig_node,
				 &bat_priv->mcast.want_all_ipv4_list,
				 mcast_want_all_ipv4_node) {
		if (!atomic_inc_not_zero(&orig_node->refcount))
		if (!atomic_inc_not_zero(&tmp_orig_node->refcount))
			continue;

		orig_node = tmp_orig_node;
@@ -442,7 +442,7 @@ batadv_mcast_forw_ipv6_node_get(struct batadv_priv *bat_priv)
	hlist_for_each_entry_rcu(tmp_orig_node,
				 &bat_priv->mcast.want_all_ipv6_list,
				 mcast_want_all_ipv6_node) {
		if (!atomic_inc_not_zero(&orig_node->refcount))
		if (!atomic_inc_not_zero(&tmp_orig_node->refcount))
			continue;

		orig_node = tmp_orig_node;
@@ -493,7 +493,7 @@ batadv_mcast_forw_unsnoop_node_get(struct batadv_priv *bat_priv)
	hlist_for_each_entry_rcu(tmp_orig_node,
				 &bat_priv->mcast.want_all_unsnoopables_list,
				 mcast_want_all_unsnoopables_node) {
		if (!atomic_inc_not_zero(&orig_node->refcount))
		if (!atomic_inc_not_zero(&tmp_orig_node->refcount))
			continue;

		orig_node = tmp_orig_node;