summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/gateway_client.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-15 00:50:21 +0200
committerSven Eckelmann <sven@narfation.org>2011-05-30 07:39:34 +0200
commit728cbc6ac1eef89660875c70a602c1a0ba8df4ff (patch)
treefcdf37937b1f01494400a0e8d57490360c64cdc3 /net/batman-adv/gateway_client.c
parent704509b8d44886cebfbaff1a9813c35dfa986954 (diff)
downloadblackbird-obmc-linux-728cbc6ac1eef89660875c70a602c1a0ba8df4ff.tar.gz
blackbird-obmc-linux-728cbc6ac1eef89660875c70a602c1a0ba8df4ff.zip
batman-adv: Use rcu_dereference_protected by update-side
Usually rcu_dereference isn't necessary in situations were the RCU-protected data structure cannot change, but sparse and lockdep still need a similar functionality for analysis. rcu_dereference_protected implements the reduced version which should be used to support the dynamic and static analysis. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/gateway_client.c')
-rw-r--r--net/batman-adv/gateway_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index a44dff3efb7f..ab597c4f9ddd 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -86,7 +86,7 @@ static void gw_select(struct bat_priv *bat_priv, struct gw_node *new_gw_node)
if (new_gw_node && !atomic_inc_not_zero(&new_gw_node->refcount))
new_gw_node = NULL;
- curr_gw_node = bat_priv->curr_gw;
+ curr_gw_node = rcu_dereference_protected(bat_priv->curr_gw, 1);
rcu_assign_pointer(bat_priv->curr_gw, new_gw_node);
if (curr_gw_node)
OpenPOWER on IntegriCloud