Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247046
b: refs/heads/master
c: 71e4aa9
h: refs/heads/master
v: v3
  • Loading branch information
Antonio Quartulli authored and Sven Eckelmann committed May 1, 2011
1 parent afee3cc commit e0a72ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f657ec0d2103571a31707711926b443a27b0c66
refs/heads/master: 71e4aa9c465fd66c110667ab5d620fb6a4ef2157
12 changes: 8 additions & 4 deletions trunk/net/batman-adv/gateway_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void gw_election(struct bat_priv *bat_priv)
return;

curr_gw = gw_get_selected_gw_node(bat_priv);
if (!curr_gw)
if (curr_gw)
goto out;

rcu_read_lock();
Expand Down Expand Up @@ -310,9 +310,13 @@ void gw_node_update(struct bat_priv *bat_priv,
struct hlist_node *node;
struct gw_node *gw_node, *curr_gw;

/**
* Note: We don't need a NULL check here, since curr_gw never gets
* dereferenced. If curr_gw is NULL we also should not exit as we may
* have this gateway in our list (duplication check!) even though we
* have no currently selected gateway.
*/
curr_gw = gw_get_selected_gw_node(bat_priv);
if (!curr_gw)
goto out;

rcu_read_lock();
hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) {
Expand Down Expand Up @@ -350,7 +354,7 @@ void gw_node_update(struct bat_priv *bat_priv,
gw_deselect(bat_priv);
unlock:
rcu_read_unlock();
out:

if (curr_gw)
gw_node_free_ref(curr_gw);
}
Expand Down

0 comments on commit e0a72ca

Please sign in to comment.