From patchwork Wed Mar 14 19:02:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10283389 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFE3F602BD for ; Wed, 14 Mar 2018 19:04:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A20285E0 for ; Wed, 14 Mar 2018 19:04:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9523D285E2; Wed, 14 Mar 2018 19:04:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B7F285E0 for ; Wed, 14 Mar 2018 19:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbeCNTEI (ORCPT ); Wed, 14 Mar 2018 15:04:08 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:33377 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbeCNTEH (ORCPT ); Wed, 14 Mar 2018 15:04:07 -0400 Received: from localhost.localdomain ([95.90.209.156]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M7Fkw-1ekh0d1cDW-00x63g; Wed, 14 Mar 2018 20:03:49 +0100 From: Stefan Wahren To: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng Cc: Kalle Valo , Johannes Berg , Hans de Goede , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Stefan Wahren Subject: [PATCH] wireless: brcmfmac: cfg80211: Fix check for ISO3166 code Date: Wed, 14 Mar 2018 20:02:59 +0100 Message-Id: <1521054179-4030-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K0:AKtzIcGXDkmnlMBU5vmv9kmt/hV/MIol/+Bq2a2tAPbEseleKFO mgE/c7P3ATIv1Zm/zUrvkS3lPv7CH14mMApIqmpsT67qaFOmldckyzSRByPrNJ/RSKLJyCh 9/nlDI6fl3zUopkSyRLHbUH4lPGm6pD1TjweNFEUKcPpa7u3w1YeVf4k/XroHdP/I/gnDaQ Gr3BIEqEgiONTp+suVauw== X-UI-Out-Filterresults: notjunk:1; V01:K0:BriPIEwWOQk=:aU/zRWqn72JiPHAQvM0xb9 DpY/BRgQMVISBbgykiRXNil0nlGMrhAM3Bjy4moTWuJCpD8JFrGnbuD6wd7R1sCzjKawYYV1o KXMzHLWbpaVJ4+VoPaPL1cl9JVXBEL6JE/wSRMreHnFJnCzNREtv4GzMacvUKGNvBzVLQct5G FV8Q9l70o+ergzBg2UasYSe3ah+ciYi/F4me7IOLnLWlWTgD1K3G1jCpkMnaVh385UV72+SpS EM7daScIpMdeBMb2RRD5WtVpLpH7aaWHWyA01neRtjWcp8Ee6Npu/XS6JBPhQIcM96tfDtr97 7bnShud7oB3fv4YX9fYaK8wVyo1WlxcttQ25CCIdZgMNJFZaxg8mvDQgSZFaYdzxHKCrEmYak dvFP2FHrU3TvLBk2LaTfZs8X3wVYY1N0l4SFMYxP1XRh+PLrGHsW9sqa8sLyIcwUQ3tD7lVo6 6RPmuq6rpj/Zm7UqbBXDCd1NO5VItNiTad3JcpTFevFaejbrT/JIIuoqYD8CMSgGIYm2F9oFY O8ZO+3TMkhjdqYZAFibvsNu7+kGc9AWi4JSHkOE8FgxBVSa9+YwzKv5190/r+baTAf3e/DDHI KtnpYZKDyjBR3TntJR5Or9SaAkr/BVPs+NrrQbFiK3RGuq35QcYQ+5elzy+A0lj5CaoACVHqV v6EnmMMRqB0K986l1gu+Zv0/VlHH+RSXeUOBihrHto8EuRhffB/wSwy7GDzNQNI0nAIoq8+HJ kW4KLbiW/hfd4enAgUBEkJLjHyZFd63ksRYmlw== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit "regulatory: add NUL to request alpha2" increases the length of alpha2 to 3. This causes a regression on brcmfmac, because brcmf_cfg80211_reg_notifier() expect valid ISO3166 codes in the complete array. So fix this accordingly. Signed-off-by: Stefan Wahren Acked-by: Franky Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 74a8302..5ed718d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6805,7 +6805,7 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, return; /* ignore non-ISO3166 country codes */ - for (i = 0; i < sizeof(req->alpha2); i++) + for (i = 0; i < 2; i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { brcmf_err("not an ISO3166 code (0x%02x 0x%02x)\n", req->alpha2[0], req->alpha2[1]);