lkml.org 
[lkml]   [2013]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mac80211: Fix bogus RCU warning from ieee80211_get_tx_rates (Was: Re: rcu)
rate_control_fill_sta_table(), whose sole caller is ieee80211_get_tx_rates(),
is guaranteed by mac80211 not to be called concurrently with
rate_control_set_rates() [1], the sole function that touches the rate table
pointer/data in struct ieee80211_sta. The RCU dereference is therefore safe.

[1]: See commit f6b3d85f7f6d6

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
---
net/mac80211/rate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index d3f414f..585297d 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -539,7 +539,7 @@ static void rate_control_fill_sta_table(struct ieee80211_sta *sta,
int i;

if (sta && !info->control.skip_table)
- ratetbl = rcu_dereference(sta->rates);
+ ratetbl = rcu_dereference_protected(sta->rates, true);

/* Fill remaining rate slots with data from the sta rate table. */
max_rates = min_t(int, max_rates, IEEE80211_TX_RATE_TABLE_SIZE);
--
1.8.2.1


\
 
 \ /
  Last update: 2013-06-10 06:41    [W:0.150 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site