linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: use rcu_read_lock before sta_info_get
@ 2011-12-25 15:06 Mohammed Shafi Shajakhan
  0 siblings, 0 replies; 4+ messages in thread
From: Mohammed Shafi Shajakhan @ 2011-12-25 15:06 UTC (permalink / raw)
  To: John W. Linville, Johannes Berg; +Cc: linux-wireless, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 net/mac80211/mlme.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 57989a0..c8a1acc 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1385,7 +1385,9 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
 	struct sta_info *sta;
 
 	if (ifmgd->associated) {
+		rcu_read_lock();
 		sta = sta_info_get(sdata, ifmgd->bssid);
+		rcu_read_unlock();
 		if (sta)
 			sta->beacon_loss_count++;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFC] mac80211: use rcu_read_lock before sta_info_get
@ 2011-12-25 15:09 Mohammed Shafi Shajakhan
  2011-12-25 16:58 ` Christian Lamparter
  0 siblings, 1 reply; 4+ messages in thread
From: Mohammed Shafi Shajakhan @ 2011-12-25 15:09 UTC (permalink / raw)
  To: John W. Linville, Johannes Berg
  Cc: pstew, linux-wireless, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 net/mac80211/mlme.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 57989a0..c8a1acc 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1385,7 +1385,9 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
 	struct sta_info *sta;
 
 	if (ifmgd->associated) {
+		rcu_read_lock();
 		sta = sta_info_get(sdata, ifmgd->bssid);
+		rcu_read_unlock();
 		if (sta)
 			sta->beacon_loss_count++;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC] mac80211: use rcu_read_lock before sta_info_get
  2011-12-25 15:09 [RFC] mac80211: use rcu_read_lock before sta_info_get Mohammed Shafi Shajakhan
@ 2011-12-25 16:58 ` Christian Lamparter
  2011-12-26  5:15   ` Mohammed Shafi Shajakhan
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Lamparter @ 2011-12-25 16:58 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan
  Cc: John W. Linville, Johannes Berg, pstew, linux-wireless

On Sunday 25 December 2011 16:09:12 Mohammed Shafi Shajakhan wrote:
> @@ -1385,7 +1385,9 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
>  	struct sta_info *sta;
>  
>  	if (ifmgd->associated) {
> +		rcu_read_lock();
>  		sta = sta_info_get(sdata, ifmgd->bssid);
> +		rcu_read_unlock();
>  		if (sta)
>  			sta->beacon_loss_count++;
>  	}

uh, I think it should be:

> +		rcu_read_lock();
>  		sta = sta_info_get(sdata, ifmgd->bssid);
>  		if (sta)
>  			sta->beacon_loss_count++;
> +		rcu_read_unlock();

Since we update a member of the rcu-protected "sta"
reference.

Regards,
	Chr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] mac80211: use rcu_read_lock before sta_info_get
  2011-12-25 16:58 ` Christian Lamparter
@ 2011-12-26  5:15   ` Mohammed Shafi Shajakhan
  0 siblings, 0 replies; 4+ messages in thread
From: Mohammed Shafi Shajakhan @ 2011-12-26  5:15 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: John W. Linville, Johannes Berg, pstew, linux-wireless

Hi Christian,

thanks for your review!

On Sunday 25 December 2011 10:28 PM, Christian Lamparter wrote:
> On Sunday 25 December 2011 16:09:12 Mohammed Shafi Shajakhan wrote:
>> @@ -1385,7 +1385,9 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
>>   	struct sta_info *sta;
>>
>>   	if (ifmgd->associated) {
>> +		rcu_read_lock();
>>   		sta = sta_info_get(sdata, ifmgd->bssid);
>> +		rcu_read_unlock();
>>   		if (sta)
>>   			sta->beacon_loss_count++;
>>   	}
>
> uh, I think it should be:
>
>> +		rcu_read_lock();
>>   		sta = sta_info_get(sdata, ifmgd->bssid);
>>   		if (sta)
>>   			sta->beacon_loss_count++;
>> +		rcu_read_unlock();
>
> Since we update a member of the rcu-protected "sta"
> reference.


ok i will add this changes also in a proper patch, thank you.

>
> Regards,
> 	Chr


-- 
thanks,
shafi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-26  5:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-25 15:09 [RFC] mac80211: use rcu_read_lock before sta_info_get Mohammed Shafi Shajakhan
2011-12-25 16:58 ` Christian Lamparter
2011-12-26  5:15   ` Mohammed Shafi Shajakhan
  -- strict thread matches above, loose matches on Subject: below --
2011-12-25 15:06 Mohammed Shafi Shajakhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).