From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4F3F37BE7F; Mon, 9 Feb 2026 14:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648859; cv=none; b=dSVkALP3UStd9pOnpkkqhl+Hx9XzFMAHPNaa0cXSsPbgGyAbof4lg/AGKa6HslXJAGsYNDFa8y+H6Drb4XZG5nCStHkdKW2bstmMCuu4KD1eKdEvBbE2cZK2rK/FXvBFTRuvFnq+InDZ+ED5YD5ZqbHb40OLmJVpcm5GRBoWOfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648859; c=relaxed/simple; bh=OODtnCwjRatCCojOYVqm24fvb3yHUmoMmpWYLgVg+oY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bmb+qNhb0hhy8XiBUQBaeU0sLqtLPe9gNZmEj2kMWjPr3u/nMKG+7cZy4LM+pqrOX4SoTqIN7/HIhxMhdRPSNPJd1VEIkoAxQPdyL5GIW5S3/58HRAipsWnac2qa/TdquFglpwwTzQXtrFAK8tG52FDyIDwdJkDp8OTNJHlQb0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jtdY3IEW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jtdY3IEW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13DD1C116C6; Mon, 9 Feb 2026 14:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648859; bh=OODtnCwjRatCCojOYVqm24fvb3yHUmoMmpWYLgVg+oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jtdY3IEWRH3MXzFv74MJOdcunCLd5CJBQnNUGd6hatWbATI+7EsCYnrPiPMwXT7KG a0IrfxRhWNYV3mYhnEQTQ+yTr0Ncpxr54YTQdl1qnCpnZttsU+fNCGkUbzAw/HCvQI AX9mQRooMNHWMq2IDOSWWXwCW0SqaoVJkIuyAExg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Baochen Qiang , Johannes Berg , Sasha Levin Subject: [PATCH 5.15 37/75] wifi: mac80211: collect station statistics earlier when disconnect Date: Mon, 9 Feb 2026 15:24:34 +0100 Message-ID: <20260209142303.183391394@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142301.830618238@linuxfoundation.org> References: <20260209142301.830618238@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Baochen Qiang [ Upstream commit a203dbeeca15a9b924f0d51f510921f4bae96801 ] 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 Link: https://patch.msgid.link/20251222-mac80211-move-station-stats-collection-earlier-v1-1-12cd4e42c633@oss.qualcomm.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/sta_info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index d1460b870ed5a..f9a5bda1f925d 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -1101,6 +1101,10 @@ static void __sta_info_destroy_part2(struct sta_info *sta) } } + sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + if (sinfo) + sta_set_sinfo(sta, sinfo, true); + if (sta->uploaded) { ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE, IEEE80211_STA_NOTEXIST); @@ -1109,9 +1113,6 @@ static void __sta_info_destroy_part2(struct sta_info *sta) sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); - if (sinfo) - sta_set_sinfo(sta, sinfo, true); cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); kfree(sinfo); -- 2.51.0