From nobody Fri Oct 17 10:31:37 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79260C4332F for ; Wed, 19 Oct 2022 13:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233801AbiJSN6o (ORCPT ); Wed, 19 Oct 2022 09:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234069AbiJSNym (ORCPT ); Wed, 19 Oct 2022 09:54:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881A3132DC1; Wed, 19 Oct 2022 06:37:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D933B82387; Wed, 19 Oct 2022 08:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F438C433C1; Wed, 19 Oct 2022 08:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169427; bh=bWaCn8E8sqheU4Kuv/pIWO/8UF7dv16NNlulGm9SNbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yf2zINUJzTDhEDVIK+ONIX/hP2n9fzWZk1ImM0FLMT3X5SUuYNl+GqypFuczS8TvL R7qgFIxp78aHNHCXhmhUO8TLKUWQ1hSUc4xghzrv6llZYk8OEU40/mnc2AGoVS/g2G ina6uMIvNNdTNs7YSBFHn1WAFOXdT7zTA3thIIXk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shaul Triebitz , Johannes Berg , Sasha Levin Subject: [PATCH 6.0 238/862] wifi: mac80211: properly set old_links when removing a link Date: Wed, 19 Oct 2022 10:25:25 +0200 Message-Id: <20221019083300.554557388@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Shaul Triebitz [ Upstream commit a8f62399daa6917e7f9efeb79bce4dd2cd494a1e ] In ieee80211_sta_remove_link, valid_links is set to the new_links before calling drv_change_sta_links, but is used for the old_links. Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/sta_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 58998d821778..9d7b238a6737 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2799,6 +2799,7 @@ int ieee80211_sta_activate_link(struct sta_info *sta,= unsigned int link_id) void ieee80211_sta_remove_link(struct sta_info *sta, unsigned int link_id) { struct ieee80211_sub_if_data *sdata =3D sta->sdata; + u16 old_links =3D sta->sta.valid_links; =20 lockdep_assert_held(&sdata->local->sta_mtx); =20 @@ -2806,8 +2807,7 @@ void ieee80211_sta_remove_link(struct sta_info *sta, = unsigned int link_id) =20 if (test_sta_flag(sta, WLAN_STA_INSERTED)) drv_change_sta_links(sdata->local, sdata, &sta->sta, - sta->sta.valid_links, - sta->sta.valid_links & ~BIT(link_id)); + old_links, sta->sta.valid_links); =20 sta_remove_link(sta, link_id, true); } --=20 2.35.1