batman-adv: Increase orig_node refcount before releasing rcu read lock
[linux-3.10.git] / net / batman-adv / gateway_client.c
index a3e842f..41eba8a 100644 (file)
@@ -54,6 +54,9 @@ void *gw_get_selected(struct bat_priv *bat_priv)
 
        orig_node = curr_gateway_tmp->orig_node;
 
+       if (orig_node)
+               kref_get(&orig_node->refcount);
+
 out:
        rcu_read_unlock();
        return orig_node;