Skip to content

Commit a203dbe

Browse files
Baochen Qiangjmberg-intel
authored andcommitted
wifi: mac80211: collect station statistics earlier when disconnect
In __sta_info_destroy_part2(), station statistics are requested after the IEEE80211_STA_NONE -> IEEE80211_STA_NOTEXIST transition. This is problematic because the driver may be unable to handle the request due to the STA being in the NOTEXIST state (i.e. if the driver destroys the underlying data when transitioning to NOTEXIST). Move the statistics collection to before the state transition to avoid this issue. Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251222-mac80211-move-station-stats-collection-earlier-v1-1-12cd4e42c633@oss.qualcomm.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent d594cc6 commit a203dbe

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

net/mac80211/sta_info.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,10 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc)
15331533
}
15341534
}
15351535

1536+
sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1537+
if (sinfo)
1538+
sta_set_sinfo(sta, sinfo, true);
1539+
15361540
if (sta->uploaded) {
15371541
ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE,
15381542
IEEE80211_STA_NOTEXIST);
@@ -1541,9 +1545,6 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc)
15411545

15421546
sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);
15431547

1544-
sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1545-
if (sinfo)
1546-
sta_set_sinfo(sta, sinfo, true);
15471548
cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL);
15481549
kfree(sinfo);
15491550

0 commit comments

Comments
 (0)