diff options
author | Sven Eckelmann <sven.eckelmann@gmx.de> | 2010-09-18 21:01:16 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-20 16:29:49 -0700 |
commit | 2250840111b362a30e35ce52770bde3692e402b2 (patch) | |
tree | 29f56d929f447d7351b771b23f507bb77495aa8c /drivers/staging/batman-adv/routing.c | |
parent | Staging: batman-adv: Introduce if_list_lock to protect if_list (diff) | |
download | linux-dev-2250840111b362a30e35ce52770bde3692e402b2.tar.xz linux-dev-2250840111b362a30e35ce52770bde3692e402b2.zip |
Staging: batman-adv: Always protect list_for_each_entry_rcu with RCU
receive_bat_packet is not called with rcu_read_lock so we must ensure by
ourself that we protect list_for_each_entry_rcu using the correct RCU
locks.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/routing.c')
-rw-r--r-- | drivers/staging/batman-adv/routing.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c index 2cf8cf98a299..58aa99ed5748 100644 --- a/drivers/staging/batman-adv/routing.c +++ b/drivers/staging/batman-adv/routing.c @@ -563,6 +563,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, batman_packet->tq, batman_packet->ttl, batman_packet->version, has_directlink_flag); + rcu_read_lock(); list_for_each_entry_rcu(batman_if, &if_list, list) { if (batman_if->if_status != IF_ACTIVE) continue; @@ -585,6 +586,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, if (compare_orig(ethhdr->h_source, broadcast_addr)) is_broadcast = 1; } + rcu_read_unlock(); if (batman_packet->version != COMPAT_VERSION) { bat_dbg(DBG_BATMAN, bat_priv, |