Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp58611pxy; Wed, 21 Apr 2021 18:26:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoXJQQhhVPuhEak3XfsiT2qSHcLk/o7vM3C+QbjiWhSfFgld02z1ZHgDfZdxXU2fZXpnGg X-Received: by 2002:a17:903:31cc:b029:e4:bd48:c8e3 with SMTP id v12-20020a17090331ccb02900e4bd48c8e3mr786753ple.40.1619054814966; Wed, 21 Apr 2021 18:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619054814; cv=none; d=google.com; s=arc-20160816; b=SKxQOttI52iytjjr5DgJNR2yTcl64UihXjw4vuw1HqhVEuUT8mPHao4E9LY0ij7Rup gaiAVqMFS2ssyqqsr8oMCMKhVVZSUSWTBmROsBltiIQO1tDMSbE3xSKq31u977CYNQ/r /iRPEKLEyZigm1NCQ+hzQX62v4BXxH4c/Z2cPAEt7muzm0jWgRqRBAxEq0SEtwvCUe87 yLry7L+71NA7la5h5aHLT5TjEpbgrF4as9gLuVqyn9uk1gh1NvrzCVLOD/l/tazvS+br /7ukNuU9JEZ7DgCKlenSF0F7WZxAZefW0PD3sSEb6y1LywTY0aL9/8YLlrysXldHPCL3 9Wsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=tXQXr+KNUx76ZAWk0EAcektLsvqjZO1UH1+f5wy0GPQ=; b=zV5xKkMhmamFSbUvS/MiQ6XkeREQPldutUcmakxaZFes42Zj4K7Ara7xzSV9Ht15YU uu1rGn5MuZnMYfA4v5Q2zldGY6ffRpyrYe/5ymtFUHIxsx9fEi3iTLj9Bycpti4pmYcN 8AD7np7UFXsrfHLByxq7rKq0UxF0ZLygiR9gs+QVcIq1W/oHc5U4gzG8oCDVlu8Lnxtb 0KOJ0N/R+qPI/tjlYttmTbid1J9FNB3R/5m2Puc4i0rbtcdz1/6GN0TCLBPaV3q7M03F fZvo5usdXLkYMcVSiMlfiiQ+s+1QM/GecNKfI3a1lXSJ1V2afC3yV3JBqsd5eDtB1vuS Dylw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si1041243plg.401.2021.04.21.18.26.42; Wed, 21 Apr 2021 18:26:54 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235102AbhDUWU4 (ORCPT + 99 others); Wed, 21 Apr 2021 18:20:56 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:36004 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236017AbhDUWUp (ORCPT ); Wed, 21 Apr 2021 18:20:45 -0400 X-UUID: d65d2aacff7c4cfa8c29179c825740bf-20210422 X-UUID: d65d2aacff7c4cfa8c29179c825740bf-20210422 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1699413348; Thu, 22 Apr 2021 06:20:07 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 22 Apr 2021 06:20:04 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 22 Apr 2021 06:20:04 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , , , Ryder Lee Subject: [PATCH] mt76: mt7615: fix potential overflow on large shift Date: Thu, 22 Apr 2021 06:20:03 +0800 Message-ID: <7fdbfede8bdc09d8099d1a812c2434e0511980ce.1619043422.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 59C17390707C3BCEA47A9E4F24D76A34F835DABB65E660C50F48AA7E63AF3A442000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix the following static checker warning: error: undefined (user controlled) shift '(((1))) << (c->omac_idx)' Fixes: 402a695b1ae6 ("mt76: mt7615: fix CSA notification for DBDC") Reported-by: Dan Carpenter Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 67af2e2d4779..93d938d56166 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -390,6 +390,9 @@ mt7615_mcu_rx_csa_notify(struct mt7615_dev *dev, struct sk_buff *skb) c = (struct mt7615_mcu_csa_notify *)skb->data; + if (c->omac_idx > EXT_BSSID_MAX) + return; + if (ext_phy && ext_phy->omac_mask & BIT_ULL(c->omac_idx)) mphy = dev->mt76.phy2; -- 2.18.0