aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-04-20 15:40:58 +0200
committerSven Eckelmann <sven@narfation.org>2011-05-01 22:49:03 +0200
commit32ae9b221e788413ce68feaae2ca39e406211a0a (patch)
treed827f989976a28fea5cdcb349c308baa98182c35 /net/batman-adv/types.h
parentbatman-adv: fix gw_node_update() and gw_election() (diff)
downloadlinux-dev-32ae9b221e788413ce68feaae2ca39e406211a0a.tar.xz
linux-dev-32ae9b221e788413ce68feaae2ca39e406211a0a.zip
batman-adv: Make bat_priv->primary_if an rcu protected pointer
The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv->primary_if need to be used, as well as spin/rcu locking. Otherwise we might end up using a primary_if pointer pointing to already freed memory. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to '')
-rw-r--r--net/batman-adv/types.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 75123b1ae0de..947bafc6431a 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -149,7 +149,6 @@ struct bat_priv {
struct hlist_head softif_neigh_list;
struct softif_neigh __rcu *softif_neigh;
struct debug_log *debug_log;
- struct hard_iface *primary_if;
struct kobject *mesh_obj;
struct dentry *debug_dir;
struct hlist_head forw_bat_list;
@@ -174,6 +173,7 @@ struct bat_priv {
struct delayed_work orig_work;
struct delayed_work vis_work;
struct gw_node __rcu *curr_gw; /* rcu protected pointer */
+ struct hard_iface __rcu *primary_if; /* rcu protected pointer */
struct vis_info *my_vis_info;
};