From patchwork Sat Oct 22 07:21:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7277 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1092089wrr; Sat, 22 Oct 2022 00:52:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eTXjdwYkcjsU2LHaSOLqdjUUquv7AzEKKkxCrvkRao7qQE7kFprKIAlNI1JANcxbI3ZZ6 X-Received: by 2002:a63:5a26:0:b0:463:7ca2:653b with SMTP id o38-20020a635a26000000b004637ca2653bmr19859611pgb.352.1666425175429; Sat, 22 Oct 2022 00:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425175; cv=none; d=google.com; s=arc-20160816; b=iXERq8HAxau7xuXOsIM+5qxZyeqEa8Dh6ZtsaFPqQ/NWaRjT1SQpacZY5eDFDpAJB0 YGi/gZFEew+teK/rOC65vBTserqjvKTETEhDUYqXJk/IqO9wwsvoPOF4NdEU/Ol4Zl9s K8AF1gGKqofQd2QoboZSsP0+d+o8x8yg3qHCX6DDRxPgz8sz4MQh8gaLiSvPRFLY8KsB vdC5FzzeIe2zFi3t8d9/WJ6bycmhdl/j3c1If28SDRJHfhf+u7X8Fs4BXNGx/HpAG+Zd rBvSf6ErOmsh2eJbxgphmRSVqfe68vOsMOsiKHQbonGB2KgMjc0HWR/pCvvtFblF1D7I 6HsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=axS1f6qLuUkKB8LOHa8gs2uBpoNPQVUglr6K1aeht3k=; b=r1pbsUY+HPbL2gFFtXu6EB67EXvKEcFg8Zow7ILCIdeTrAteC2KvJ5OkYkT2wKzPZD RebzG5SgX6uQKaMAYKI3fded7asyBhovm3mEzm7l1EGFRjdnrlnHh8J0oYX5RIsjyF2R cMJOpWE4vK+DTSEm7fkem8HE6ZnODyELJgc78SpytXYTrd62iDuYtwq8vgTgrGc79TcX yp9ovjxlo61BxSLgAsPJvBOmjfmgoCtBwp4qaOC5X3XI972PQSyRwsb9x0gZQqKtuWM3 Zz55XvF2WakuFUSJF4SI6Wkh562Z134Y/Fb9f2p9Der1Ur5qL5ps+uTbl9LjnpNQb2ZA 8Cag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G5aI5RvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020a056a0016c200b005634a0ecb53si26926033pfc.265.2022.10.22.00.52.43; Sat, 22 Oct 2022 00:52:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G5aI5RvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231704AbiJVHwa (ORCPT + 99 others); Sat, 22 Oct 2022 03:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbiJVHtl (ORCPT ); Sat, 22 Oct 2022 03:49:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73FBF2C2AC2; Sat, 22 Oct 2022 00:46:17 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6A3C160B91; Sat, 22 Oct 2022 07:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82659C433D6; Sat, 22 Oct 2022 07:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424602; bh=PBClYfgcUgCNfOMwp2cjYimZKZ/95lBXgpCYtvQU0AM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5aI5RvX8CxCipiUtv23eGuNiLlIdq8xJ+S99mxsdn1K9BVcp9kf5GfLmDKW7oury 9bAOs+f6zzvPKeaXIqZ5BG1lKYRlUDGIuiBjkzxDYZhFUgddqTCzgle34xZNvQ5g5g k7vJ0cqropbPhtADKxhCGjj6Vu35hXKPNqMInBpo= 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 5.19 208/717] wifi: cfg80211: get correct AP link chandef Date: Sat, 22 Oct 2022 09:21:27 +0200 Message-Id: <20221022072452.095033007@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747373444555789159?= X-GMAIL-MSGID: =?utf-8?q?1747373444555789159?= From: Shaul Triebitz [ Upstream commit bc1857619cc7612117d2ee1ed05b5bfeb638614b ] When checking for channel regulatory validity, use the AP link chandef (and not mesh's chandef). Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/reg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c7383ede794f..d5c7a5aa6853 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2389,6 +2389,10 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) switch (iftype) { case NL80211_IFTYPE_AP: case NL80211_IFTYPE_P2P_GO: + if (!wdev->links[link].ap.beacon_interval) + continue; + chandef = wdev->links[link].ap.chandef; + break; case NL80211_IFTYPE_MESH_POINT: if (!wdev->u.mesh.beacon_interval) continue;