linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] net: mac80211: sta_info.c: Add lockdep condition for RCU list usage
@ 2020-04-09  8:29 madhuparnabhowmik10
  2020-04-24  9:23 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: madhuparnabhowmik10 @ 2020-04-09  8:29 UTC (permalink / raw)
  To: johannes, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, frextrite, joel, paulmck,
	linux-kernel-mentees, Madhuparna Bhowmik

From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

The function sta_info_get_by_idx() uses RCU list primitive.
It is called with  local->sta_mtx held from mac80211/cfg.c.
Add lockdep expression to avoid any false positive RCU list warnings.

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
 net/mac80211/sta_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f8d5c2515829..cd8487bc6fc2 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -231,7 +231,8 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
 	struct sta_info *sta;
 	int i = 0;
 
-	list_for_each_entry_rcu(sta, &local->sta_list, list) {
+	list_for_each_entry_rcu(sta, &local->sta_list, list,
+				lockdep_is_held(&local->sta_mtx)) {
 		if (sdata != sta->sdata)
 			continue;
 		if (i < idx) {
-- 
2.17.1


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

* Re: [PATCH 3/4] net: mac80211: sta_info.c: Add lockdep condition for RCU list usage
  2020-04-09  8:29 [PATCH 3/4] net: mac80211: sta_info.c: Add lockdep condition for RCU list usage madhuparnabhowmik10
@ 2020-04-24  9:23 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2020-04-24  9:23 UTC (permalink / raw)
  To: madhuparnabhowmik10, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, frextrite, joel, paulmck,
	linux-kernel-mentees

On Thu, 2020-04-09 at 13:59 +0530, madhuparnabhowmik10@gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> The function sta_info_get_by_idx() uses RCU list primitive.
> It is called with  local->sta_mtx held from mac80211/cfg.c.
> Add lockdep expression to avoid any false positive RCU list warnings.
> 

Applied.

johannes


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

end of thread, other threads:[~2020-04-24  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  8:29 [PATCH 3/4] net: mac80211: sta_info.c: Add lockdep condition for RCU list usage madhuparnabhowmik10
2020-04-24  9:23 ` Johannes Berg

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).