Skip to content

Commit

Permalink
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux…
Browse files Browse the repository at this point in the history
…-merge

Included changes:
- prevent NULL dereference in multicast code

Antonion Quartulli says:

====================
pull request net: batman-adv 20140527

here you have another very small fix intended for net/linux-3.15.
It prevents some multicast functions from dereferencing a NULL pointer.
(Actually it was nothing more than a typo)
I hope it is not too late for such a small patch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Jun 1, 2014
2 parents dbfc4b6 + af0a171 commit 6ce995c
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 6ce995c

Please sign in to comment.