mac80211: sta_info: Add lockdep condition for RCU list usage
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Thu, 9 Apr 2020 08:29:06 +0000 (13:59 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Apr 2020 09:31:20 +0000 (11:31 +0200)
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>
Link: https://lore.kernel.org/r/20200409082906.27427-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index f8d5c25158293df653236d566418c364da622636..cd8487bc6fc2e368f01e41275518a4056c1cc552 100644 (file)
@@ -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) {