8ffdea813e32cee3c60be36fb9e6a5e077e51ea0 used rcu_read_unlock without using rcu_read_lock when gw_get_selected_gw_node didn't return a valid gw_node.
Signed-off-by: Sven Eckelmann sven@narfation.org --- gateway_client.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gateway_client.c b/gateway_client.c index 3d0050b..a5757da 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -312,7 +312,7 @@ void gw_node_update(struct bat_priv *bat_priv,
curr_gw = gw_get_selected_gw_node(bat_priv); if (!curr_gw) - goto out; + goto freeref;
rcu_read_lock(); hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { @@ -350,6 +350,7 @@ deselect: gw_deselect(bat_priv); out: rcu_read_unlock(); +freeref: if (curr_gw) gw_node_free_ref(curr_gw); }