diff mbox series

[3/4] net: mac80211: sta_info.c: Add lockdep condition for RCU list usage

Message ID 20200409082906.27427-1-madhuparnabhowmik10@gmail.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series [1/4] net: mac80211: util.c: Fix RCU list usage warnings | expand

Commit Message

Madhuparna Bhowmik April 9, 2020, 8:29 a.m. UTC
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(-)

Comments

Johannes Berg April 24, 2020, 9:23 a.m. UTC | #1
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
diff mbox series

Patch

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