From patchwork Fri Apr 9 09:40:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 419150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71C6DC433B4 for ; Fri, 9 Apr 2021 09:40:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E32261108 for ; Fri, 9 Apr 2021 09:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbhDIJkt (ORCPT ); Fri, 9 Apr 2021 05:40:49 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:44248 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230181AbhDIJks (ORCPT ); Fri, 9 Apr 2021 05:40:48 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=kveik.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lUncv-000ELR-4r; Fri, 09 Apr 2021 12:40:34 +0300 From: Luca Coelho To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Date: Fri, 9 Apr 2021 12:40:18 +0300 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210409094028.356611-1-luca@coelho.fi> References: <20210409094028.356611-1-luca@coelho.fi> MIME-Version: 1.0 Subject: [PATCH 05/15] cfg80211: don't WARN if a self-managed device doesn't have a regdom Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Emmanuel Grumbach This can happen if it booted in RF-Kill and didn't have a chance to get its regulatory domain yet. This can happen for example if hostapd is started on a device that is blocked by RF-Kill. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho --- net/wireless/nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 521d36bb0803..f56307185b8a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -7742,8 +7742,8 @@ static int nl80211_get_reg_do(struct sk_buff *skb, struct genl_info *info) REGULATORY_WIPHY_SELF_MANAGED; regdom = get_wiphy_regdom(wiphy); - /* a self-managed-reg device must have a private regdom */ - if (WARN_ON(!regdom && self_managed)) { + /* a self-managed-reg device should have a private regdom */ + if (!regdom && self_managed) { nlmsg_free(msg); rtnl_unlock(); return -EINVAL;