]> www.infradead.org Git - users/hch/misc.git/commitdiff
wifi: mac80211: reduce the scope of link_id
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 3 Sep 2025 08:39:03 +0000 (11:39 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Sep 2025 09:19:03 +0000 (11:19 +0200)
Reduce the scope of the link_id variable in sta_set_sinfo to the 'if'
scope.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250903083904.1972284-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index 8c550aab9bdce0d8ccb72ed5af2ddfffe6aa4fe3..8e275f0a12383e556b8e66703788aad428925f9e 100644 (file)
@@ -2962,7 +2962,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
        struct ieee80211_sub_if_data *sdata = sta->sdata;
        struct ieee80211_local *local = sdata->local;
        u32 thr = 0;
-       int i, ac, cpu, link_id;
+       int i, ac, cpu;
        struct ieee80211_sta_rx_stats *last_rxstats;
 
        last_rxstats = sta_get_last_rx_stats(sta, -1);
@@ -3204,6 +3204,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
        if (sta->sta.valid_links) {
                struct ieee80211_link_data *link;
                struct link_sta_info *link_sta;
+               int link_id;
 
                ether_addr_copy(sinfo->mld_addr, sta->addr);
                for_each_valid_link(sinfo, link_id) {