Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2875286pxu; Sun, 29 Nov 2020 07:37:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoDSIDSZtwLUqwjAaAEpckuGWtb45hP4NCmrlcX0Nm4g0jylDFepi4Vckc4dj1hKNMGcux X-Received: by 2002:a50:d884:: with SMTP id p4mr417607edj.120.1606664220761; Sun, 29 Nov 2020 07:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606664220; cv=none; d=google.com; s=arc-20160816; b=MSNCrwq2mU5JXoIWZ0lwQmox2tYqHfQPmCsTr/ZG2HFhRQHpyjewN7Fba+OEoFen32 hGX5ThwGLWKIuTWH2Bh/HAHLi8PvePy6WHkwbQSsUhnffMiiGdkAJ3B+EPRlg1K31v+h W5qthwP+3Z5wgnd67s0zH2xdA4q+imT24YQH6oFz9AOEyOIATE/n5NN0DQPxweHpjq2I ofgSyqQL/gnEvqBXVAMLxRgR21pHry0MEJD050de7D6nRu4vpBHjJcUGSO1tZMkcvOa4 ROOotz725OsDlh3B14WdfH3VTPI6wiTUHAdXHp7YB4pvf0qvEeWpTlidyqvvRb/PDEc8 bB2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=tEvH+16rY7GQRqwURwmEFXX9Ht6ofn/6SJuFmAxxGK0=; b=vWehRfCQQv5MzXtMkKZFg6tT6tzPFZJrCbYfjr6tyosLxbqeQbJKUPY17mesRYMNlP 7RJC8HQ79kvZeetwCsrPHEpi0OLJbBI+my8E0rQG6AvOqZIEyHh8E5dPSfC7Hwwu6OUa tUwi9ebqhY54KbYrPtHz64MaB46NJD+q7o2BB1kGpvpU/BjW6FsIEUvXSBzcedNwgs36 1fAPN2ixRhREm0sQQli84V5kTUZ6M3HqSMM9cZ8d6Aq6zDc5LJ3Szq4iTMsZsf7b7H2A I3umq3pg5yd1A8lbS6KWwVlnlFRvd+w1FtbjWWyctJ8WDnl3nj3Ph0hnJgQlnBBETfOB 5eXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si4877881ejf.612.2020.11.29.07.36.37; Sun, 29 Nov 2020 07:37:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728050AbgK2Pbv (ORCPT + 99 others); Sun, 29 Nov 2020 10:31:51 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:33556 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728008AbgK2Pbv (ORCPT ); Sun, 29 Nov 2020 10:31:51 -0500 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kjOfH-0035ld-S0; Sun, 29 Nov 2020 17:31:04 +0200 From: Luca Coelho To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Date: Sun, 29 Nov 2020 17:30:51 +0200 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129153055.1971298-1-luca@coelho.fi> References: <20201129153055.1971298-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.4 Subject: [PATCH 09/13] cfg80211: Save the regulatory domain when setting custom regulatory Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ilan Peer When custom regulatory was set, only the channels setting was updated, but the regulatory domain was not saved. Fix it by saving it. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho --- net/wireless/reg.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index a04fdfb35f07..094492b62f8a 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2547,6 +2547,7 @@ static void handle_band_custom(struct wiphy *wiphy, void wiphy_apply_custom_regulatory(struct wiphy *wiphy, const struct ieee80211_regdomain *regd) { + const struct ieee80211_regdomain *new_regd, *tmp; enum nl80211_band band; unsigned int bands_set = 0; @@ -2566,6 +2567,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, * on your device's supported bands. */ WARN_ON(!bands_set); + new_regd = reg_copy_regd(regd); + if (IS_ERR(new_regd)) + return; + + tmp = get_wiphy_regdom(wiphy); + rcu_assign_pointer(wiphy->regd, new_regd); + rcu_free_regdom(tmp); } EXPORT_SYMBOL(wiphy_apply_custom_regulatory); -- 2.29.2