Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp664286rdb; Fri, 22 Dec 2023 00:54:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1PTJFTUgsBDbo5O9hftZqO9wyuZ3hjM2TiFVxlpOf25enWgHLoySQgDD8gSGVsH4vBb4J X-Received: by 2002:a05:622a:593:b0:427:7bdf:5a87 with SMTP id c19-20020a05622a059300b004277bdf5a87mr2194538qtb.10.1703235254280; Fri, 22 Dec 2023 00:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703235254; cv=none; d=google.com; s=arc-20160816; b=hS1R0jgzeW1yMso4fCFpBkOO5z8s9qyxhpY+G+9bVYRKgjCyw4l1q7ex5mGFI3fP5/ 9dD5bTs7UPhB5Rv9phsu/YDtqKBWNvmaqvFYPhBFaBhmttVfpN7Wppsh/x6bI61nqJTC dRJyFUkRNf8ok2t86HuLn3vGUjuQm2AKDYZPktsb4MbqdyplqBCHracELu2CW6U5QBUU K93g7vCwqzIr0VAGGWloCKMMp2PgImFgD/tvn24xPrXemQwdaGbfhrO0pqkVVjNA0+VD hbr+lkYPqHI53BlVCPqDZ4/GLrrl4YgYib1w/HOIwC2tI8UgnxwXxl3H1MA9nuZstmIC iGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yERtKqeMRnRz8EWKdpgnTZ0HdSoa6D6t6hyWkYUHSl8=; fh=xmX3nUiCDRywM7GN/jnkxEI0WXifvWaaBmhMyTMYa4c=; b=ChJM+8ZSSH1K8/ALLmsRX+lK47NAdcQIPPQXA3SS1LD6+Owd2cPHvmMD1SunjzV4H/ 8wXiLykq4aZ+Ew5cE+Xa9dsMMO1QVLRAC4bxKh8lJ4a/ptuHHvbYOaWXHYOVdJayUzg8 b1bVdc8Wd9Ef27Se1PYpQSibd5Qu98oIKZTb8itsizO7OpTzm4lRCHi0lmU2mC44VLyi LQUo7hJch9SgAQXuVNJgslDTdJfg5KgxKMxrvo/T1HvLheeUjsVvfCjs+UDm9GTVZSIH ZU3BI8YOXCHFD2inZu3lbyZgxJNWDDo1N30ZGY/T04kosibNnj7JMtg6tndY7abtHgGU AZvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RcPHZyZX; spf=pass (google.com: domain of linux-wireless+bounces-1213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1213-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v6-20020a05622a014600b004260c7e7d2dsi3818544qtw.608.2023.12.22.00.54.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:54:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RcPHZyZX; spf=pass (google.com: domain of linux-wireless+bounces-1213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1213-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com 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 0EA9A1C22568 for ; Fri, 22 Dec 2023 08:54:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 121CE1119D; Fri, 22 Dec 2023 08:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="RcPHZyZX" X-Original-To: linux-wireless@vger.kernel.org Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 66BE5FC00 for ; Fri, 22 Dec 2023 08:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 9ed3056ea0a711eea5db2bebc7c28f94-20231222 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=yERtKqeMRnRz8EWKdpgnTZ0HdSoa6D6t6hyWkYUHSl8=; b=RcPHZyZXdpZoG0+FKCFXRMiTNoJiP2LGMAnf0KCQ5o5AYzUuGLseJ1FJyhNd1iSVzqPr/zibKDDoR2ThAvW7wWnOBm/wYtVz3EKDmtzL3KNyBaZkgCakiM04cTA3qXRrihiUy7vYLA9K03CXnCBvKFlj/PfGfVuyGYtax0D1axo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:7eb9bc52-9aa9-4951-a4dc-d57cab1ae611,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:5d391d7,CLOUDID:e753768d-e2c0-40b0-a8fe-7c7e47299109,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-UUID: 9ed3056ea0a711eea5db2bebc7c28f94-20231222 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1626836302; Fri, 22 Dec 2023 16:53:47 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 22 Dec 2023 16:53:46 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 22 Dec 2023 16:53:46 +0800 From: Mingyen Hsieh To: , CC: , , , , , , , , , , , , , , Ming Yen Hsieh Subject: [PATCH v1 1/4] wifi: mt76: mt7921: fix incorrect type conversion for CLC command Date: Fri, 22 Dec 2023 16:53:35 +0800 Message-ID: <20231222085338.4530-2-mingyen.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231222085338.4530-1-mingyen.hsieh@mediatek.com> References: <20231222085338.4530-1-mingyen.hsieh@mediatek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--4.267000-8.000000 X-TMASE-MatchedRID: zfURmU8ZpfG0A65es43yNsFWmsryu9ZfN/BTU5ZfZRIFi3R9x/2qQp7O 325kkkmthleoxClEaad3ASMeJ378tBdg+HtW3bymnVTWWiNp+v9MkOX0UoduuQNBdqC0PZz4o8W MkQWv6iXBcIE78YqRWvcUt5lc1lLgjMejjvPkBr7gBxE/u1mqEiwnOlZD/aCzUx3FFlKt//Pssr Rv1LUSc8ORKiRcdxPZV6BJkTJ5zLM6JULy9tmMFNQv8m9xy61E6bVO/2eNXpp5lSmbrC6fdtr/T o2FgNrjDLMIOOVTHz2nbLeYgH6K31Zca9RSYo/b X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.267000-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 526BBC830612C1FDA913175EE9C294AFD8814AA39D53E68BE6423B740288DE312000:8 From: Ming Yen Hsieh clc->len is defined as 32 bits in length, so it must also be operated on with 32 bits, not 16 bits. Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC") Signed-off-by: Ming Yen Hsieh Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312112104.Zkc3QUHr-lkp@intel.com/ --- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 5fcee178b698..f1145002c900 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -1271,7 +1271,7 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2, .mtcl_conf = mt792x_acpi_get_mtcl_conf(&dev->phy, alpha2), }; int ret, valid_cnt = 0; - u16 buf_len = 0; + u32 buf_len = 0; u8 *pos; if (!clc) @@ -1282,7 +1282,7 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2, if (mt76_find_power_limits_node(&dev->mt76)) req.cap |= CLC_CAP_DTS_EN; - buf_len = le16_to_cpu(clc->len) - sizeof(*clc); + buf_len = le32_to_cpu(clc->len) - sizeof(*clc); pos = clc->data; while (buf_len > 16) { struct mt7921_clc_rule *rule = (struct mt7921_clc_rule *)pos; -- 2.18.0