Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp223413rdh; Wed, 7 Feb 2024 02:59:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IESav+MumhX8kcB9J0QkwGfLgXhjuWMHCz3hkMI/9D3z1sD1KFJJOTQboA/i77+QFA47pQB X-Received: by 2002:a05:620a:13e8:b0:785:932f:a6ef with SMTP id h8-20020a05620a13e800b00785932fa6efmr3743876qkl.64.1707303572040; Wed, 07 Feb 2024 02:59:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707303572; cv=pass; d=google.com; s=arc-20160816; b=GGUl8CYobp+WcqgXz8wxRRLzf6injtPfLWppwUBTj6mDwuwy+prswb7FPrxn2I6+0M L+lK7DFl0zvfD2bJyC1lEXjkM77epLszAWyAUdAAY2fdsVKWEDdl3D8wb7UlS9+3JWAs ZHGr3qiNsEEwWXHrpsiVnrlF/7G1G79BJZjM0l6Bgm4JtOo9h/4BX4w8KiKZcXGZq/LF kkg3k+TJca3u+TxILfe9alrAtsvPKUc0uh7+pBb8Snu3f1utQYRMtxAew3D3f3BOOVKG XDHfNLZbY0Wreh0QdS7O+m+fnbxCVVzH774u3M6G3IE8ih7WYGXysT02zb2KH5jmLAbp uOOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=vuehioarIzzvAMhoNza60aWgCWeeRAMsn65lO9qWKp4=; fh=VuUTmQ1PxWgSmqHrtu50c06izu0KtTwjiA2Ag4G8sns=; b=epMRn4mKvwLKdkkNB1M6XSQ/kaJcTdfsa9BoPyI9hPqEpOemZVAFfg1q2p+mxDZO7v z9t1DT81F14vOQsfwBz7+hLIulXCZmgPO/GFAojrrBMD5mYLagQlj7akjbSNnLE7/To8 GBDGcYmwCILCgVTMpE2dj7RirLmCo8v75+ZkMNQ131ogzra/Gvx7dlqzuVWFlvO3nCeU SNBpJp8qm3ewcPIaj7Waf0ha518R/BHAy+HYCfJdWmZBsqTQNM2fPE/PqnG/TylsHcP8 70+/YIcHIe09kgzbG9nTGMyHnxzYLTivAJb4qvykZznCjGu88tuuLSJLZUyK7cJ5YgcF Ql+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DyvGAdWu; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=2; AJvYcCVjZ5v6aee79xpiQEQlXL7dnz/hQIy7Mv5Pdvz0Uz64+XRtUmGrNWJaYVK2FK1bWF78yFZ++GFY3R0+5aA6v4nIc3qJDQxKyzTCwVLUkg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z23-20020a05620a08d700b0078391fc99b9si840211qkz.677.2024.02.07.02.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 02:59:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DyvGAdWu; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B29591C21050 for ; Wed, 7 Feb 2024 10:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B6D51B7EE; Wed, 7 Feb 2024 10:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="DyvGAdWu" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 AE6E21B7E3 for ; Wed, 7 Feb 2024 10:59:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707303568; cv=none; b=iSrs5TeXXymg3MVaPh2z2XDdK3s93jKKlh+Yzw8Wa3xElfZHWl8eRdXmcKzVadmbH/E/yYHnECUonRW0WZptBbolpDkxpPKR/s9Haiq8eGVCXjzPaQo+5gIBIYuNqx3gNsJMIhKVNwOWBGMMIgTLUTNJe+0YT7Lo2VBBjlvweWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707303568; c=relaxed/simple; bh=R9tvgDQShFmKNZFYmFfKi5x/0uH3yQJ75zeuuumB4u4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jcFAtKq8HvieZuDN6WQyOlOA2eU/95Sc/hrRFvfI/y6Dyz/7gF226WX+J2Eo9S2cyBtw+w9YRT60KD2dC5URczN27UuFU9XkC/rRGALJYfjZfim+FRzzSSYsry0r105CEZ9Qr/O0/giadiwM2MoPkN7BFLkt0i3/spCxP94goXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=DyvGAdWu; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=vuehioarIzzvAMhoNza60aWgCWeeRAMsn65lO9qWKp4=; t=1707303566; x=1708513166; b=DyvGAdWuK7YzUNRdN6s4kptPDzhmbbKb53C2O49aSn6p1SwqMAKnDb5u0pXw3jwOvJr+pThuID7 BRvAXaamjH28TkuaCTeB5eJlzavBJp75XwNkIaiVr9piSKLIdwyJ3Uwo3ob7NkKsFXNrLPVkSntbU xpineLhGnZqsE1Rvk+BozPt+pJwosYRuVxe8FDif+Dzssk5L0b12G19FG1/1m/kfqWC+Cx4+gJUlb GC239Updw78hnNbvTovbizQq8UtPFFS9WcmSkIv0O3DDM+p4JzmEBkhwrsPOef4KQXg2YLuUoJ39+ TKS5ntabF2LIQYjEaFg1ABb8ktJ0qBk/ErkA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rXfeE-0000000FsSv-3UJr; Wed, 07 Feb 2024 11:59:23 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Bert Karwatzki , Lorenzo Bianconi , Felix Fietkau , Ryder Lee , Johannes Berg Subject: [PATCH v2] wifi: mac80211: don't use sband->band early Date: Wed, 7 Feb 2024 11:59:20 +0100 Message-ID: <20240207115920.43cbedffb5c3.I4968e12275a3f95926e3f3ccae81e50f23fe4d4d@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg Some drivers may (notably mt76 does) not set up sband->band before registering, and cfg80211 will fill it in later. But since the HT/HE capability check mac80211 required it to be initialized already, otherwise failing things. This really isn't necessary though since the code is iterating the list of bands, and has the 'band' variable available. Fix it to not require the sband->band to be initialized already. Fixes: f04d2c247e04 ("wifi: mac80211: disallow drivers with HT wider than HE") Reported-by: Bert Karwatzki Debugged-by: Bert Karwatzki Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218466 Signed-off-by: Johannes Berg --- v2: add the right tags --- net/mac80211/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index e05bcc35bc1e..6d38b8dce8a2 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1124,7 +1124,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) supp_he = supp_he || iftd->he_cap.has_he; supp_eht = supp_eht || iftd->eht_cap.has_eht; - if (sband->band == NL80211_BAND_2GHZ) + if (band == NL80211_BAND_2GHZ) he_40_mhz_cap = IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G; else -- 2.43.0