Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2375498lqp; Sun, 24 Mar 2024 16:33:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFl3aHMUcKKpjcSww1gwtg2r6810i5rP+f6kRDgnJFcNxQmE0OWSr0TqHNEmNm5cYwvtiQ3sZ/GS/3g7qVE/+nfWLbPpDvj1laIZJ/eQ== X-Google-Smtp-Source: AGHT+IHdBRU/hxGm8qe6WzpvT3uE2fJLebZCgpAEBp/8RNHOqaGeNmutII6mG6oQK2AdhccwGU+0 X-Received: by 2002:a05:6a20:5482:b0:1a3:b173:1a97 with SMTP id i2-20020a056a20548200b001a3b1731a97mr6908414pzk.1.1711323203097; Sun, 24 Mar 2024 16:33:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711323203; cv=pass; d=google.com; s=arc-20160816; b=lvsn67YHi2UcDJvumuXms0j2wECUW4G+3v+/XeUK5HGKKP42dsFp3J6L1jI1tJTnLm dhRR90Aj1x9uzCYuOgwgsLhIGmV0pCVQRrhcZ0s38Lea9NEr7m1fSZacspwHhTrz9lg+ U9GaPbNfXIBbn8ZRhf29Bd4LaiX++/1QVIRSjoRhguL0DiTfqet/yMMC7H6dyZNfcAfp TLzeLUM2FrItSujYouGyrM92VZ+q2w16OVlQo1RwuHavNY6mD55FYNRXVGH0vAvtLFv7 beeALIDRcvGlmDTsb4ZQDSl+B5jSnWtx+/AIo650BHYxH9NaugPBveayeB8DHEPiVhQZ eV4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KQ8aSN4fek2T56eEhPJbzG7W5gxKuJutYp+cjV7FKNo=; fh=mpTIX8jymwjFcKtYQCuzrvMVaoKI8E+DArGMBatyMcs=; b=Ury64JDrtmt4X6KGB1oPDvXP395C2pNHfD827Rx7Jwac/bdj8HeSkZPZnhzOhgsT2g jfV3jn27fbsQuKKM9vIycy/E9RDde5GaI8/Hx2ikZ6z3xTGm152a+3AySj4RMq9mDDHB R3pc/upuiNunt/bZOs0cpemCM9Zozbqu7xM5WGAVgiq0Q61jU9QGJi5pWRU0dOs1SEtn 9Mdcpe4tpk1N6HORHO/IFwurMQXTbCYEfsCYGPmPJbKXo+AIOhQuq8CE/SQJysQZcvGq kI6NefTHXd+sNBAjnpPHriAAm8i7Baxqi6DX9F4dY2CwX4U68m7PV5gj5cVQXFhhWTJp i1XQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y9ZCoII8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113140-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u34-20020a634562000000b005cdacf9065fsi6293636pgk.720.2024.03.24.16.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y9ZCoII8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113140-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C576B280EF3 for ; Sun, 24 Mar 2024 23:29:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C11E16EC05; Sun, 24 Mar 2024 22:39:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y9ZCoII8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8594D16EBE4; Sun, 24 Mar 2024 22:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319947; cv=none; b=qrelHRpGuKmhfcvF2nAsfo3QXcCKQCswtSPeL+YnpOJaOTTkauo7/qccvvo8d0h6U1sM1ZYoKWNyZke01gid3EAj+c4at69X0wwXK88HeGCmrDjJNevuoQoZPca6E/0aN7RtzjuH5fNd+qcAZMROl3VZTl2eTrzG4SOjggatq08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319947; c=relaxed/simple; bh=sv4/1oKiZ1NfQVtAx8ws3BB1smFkKwt+29gB5TTjeXo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aT7jZcuPuBPZ7+czREXuVCxmEmf7lEdZfARA0YzD2pXCgbqUdrK47eHF2oBWmc6zSzT2UGknUJntDZWJK3Ga+/CAIMdZAOkaGGrkAl7aCJKi25z2oj0AJW1OMcVF3Y9sD2FRNbHHqrOvTvxlH77uHFquPdSDtlZupfcfLqDfVlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y9ZCoII8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E69C433F1; Sun, 24 Mar 2024 22:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319947; bh=sv4/1oKiZ1NfQVtAx8ws3BB1smFkKwt+29gB5TTjeXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y9ZCoII8VoQ2xVAp6bKD7t7aow+N/YrgNTe/wonLjn0CSUOQr0AfojkToUIuehMn6 sBc6ZpEMSlGTYqirVIXjnxXxg+Zu+ofEBE2GfqDiu0Dn0LnhKD7qY5Duupwn0jGKAq x6jJEDj9q3ynHa4Z3Bm+UqxWd0SIyFvDEYzaoBeC4989hMALJx3RPtsc2OvfHV7BZB zsIpSRc6+/+ape9lD/bC+XsIiNR/xfd6m4VDc6pjLvme0CILQwHNXLePJd5Hx7kufs uxbsodQ0bRCqpTFGlLY4h70k+jO/ElO1a1hbJlUf6wSJCrsbxVWEY4eXc+m1KOv3kI /Lexnf09uNqCA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ming Yen Hsieh , kernel test robot , Felix Fietkau , Sasha Levin Subject: [PATCH 6.8 253/715] wifi: mt76: mt7921: fix incorrect type conversion for CLC command Date: Sun, 24 Mar 2024 18:27:12 -0400 Message-ID: <20240324223455.1342824-254-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Ming Yen Hsieh [ Upstream commit b6351ef9994ccb93b2447d396a0c517964dff2bc ] 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/ Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- 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 f5582477c7e4c..8b4ce32a2cd12 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -1272,7 +1272,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) @@ -1283,7 +1283,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.43.0