Skip to content

Commit

Permalink
batman-adv: fix NULL pointer dereferences
Browse files Browse the repository at this point in the history
Was introduced with 4c8755d
("batman-adv: Send multicast packets to nodes with a WANT_ALL flag")

Reported-by: Sven Eckelmann <[email protected]>
Signed-off-by: Marek Lindner <[email protected]>
Acked-by: Antonio Quartulli <[email protected]>
Signed-off-by: Linus Lüssing <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
  • Loading branch information
Marek Lindner authored and ordex committed May 31, 2014
1 parent 554215c commit af0a171
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/batman-adv/multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit af0a171

Please sign in to comment.