Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3820208ioa; Tue, 26 Apr 2022 10:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWsLVQfElMum2z3CY7BUwhHz6yP10LeN7xQsbNen7vcHtLpj5fbLvctL4ea2AobGzLHiIQ X-Received: by 2002:a05:6402:2788:b0:424:890:e4e0 with SMTP id b8-20020a056402278800b004240890e4e0mr25867681ede.44.1650993726067; Tue, 26 Apr 2022 10:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650993726; cv=none; d=google.com; s=arc-20160816; b=xMgulPl1RPZ93p5RkpCZS2EQW5uRKH0ZP8mQTp7uOGQgBybYHN4lMymB4wTyftWxQ1 FoFRo26y5rGkccIplqbRPihMNuZG8ti/N6a0axEWlK+6pOpSpdUjs5pXnDKKIOywrkXZ JGEG02CpxxhsxjgcmEZmqyJJz2KKBDqoP2frX48UD79VZRUfGVOh1qnxvP6GoBXiTxow eO/Xvtay6NguzaHzzaKdSRtJz4+AXP1YVctEx17FyhVIzY4Ym4iAxLXrwoAqNA2OKwLb edmL1XcItNLR0LTrPc+Sfgo5p32boNoxn7ZFFV4kuCET0jQ7B1+aogooIXJ/pUAlO+j6 tDug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UH27xbcK0DtGpgitaqZ8aNFWho93aQrx1qp1jrB3Xl0=; b=qRhC+JDdvZN0YSMU3hTCrPy96jH8We7FXwtYcosUGRnnf05ZfGJal1yk81z5ajnPrt 3gpoBzslOuX9ok2By3u8P90z7KMGX7778gqhxCL2SjxiTqtt6w5Tim9a8JpFqj0AmX0v ak47r+99RKMN+3+mH0Ax63FbL8/GMy8T7WUs+gKFdWFeDOvHbY0NkB98pLLEnaWRP3S5 W4KM/rsZoa/CfTrWf43gXDOZd0c8EKkuexxS45W9gkzVzSOgqy2brzRd0180XsT3EMBE cKhlrk8Owdmk/DqNMfT68JlZ1APXx/ktGQp+i/ko+NkH+6rEF3E0yFXNlPXBKVVH2TCN KnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IWI0JbGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs1-20020a056402304100b00425c12f2d9esi11222520edb.118.2022.04.26.10.21.21; Tue, 26 Apr 2022 10:22:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IWI0JbGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347362AbiDZJKr (ORCPT + 99 others); Tue, 26 Apr 2022 05:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346830AbiDZIuk (ORCPT ); Tue, 26 Apr 2022 04:50:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9358F17036C; Tue, 26 Apr 2022 01:39:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F38DA60EC4; Tue, 26 Apr 2022 08:39:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBDE4C385A0; Tue, 26 Apr 2022 08:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962343; bh=0up0+3ng2gkf9fVKVYD32dBPHhE8G+CBylS47GayzIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IWI0JbGVGsEv4oPzWvXV906D9sanRp/IGzO2cnUhssFQpGWpPkxORT/Kk6az57i/K /4LC2iS/uLw9cDQs7rdtDZji9xaIhuOxMG0/3mfsXmQ2bLtiyBvofE0iUnM1kTjmyq uuu6JRrj7ammpi4K0VJLg17XuZ6YvMIZr6oSNDVc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Jakub Kicinski , brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org, Arend van Spriel , Sasha Levin Subject: [PATCH 5.15 064/124] brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant Date: Tue, 26 Apr 2022 10:21:05 +0200 Message-Id: <20220426081749.121241727@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov [ Upstream commit 6fb3a5868b2117611f41e421e10e6a8c2a13039a ] Fix: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_drivestrengthinit’: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3798:2: error: case label does not reduce to an integer constant case SDIOD_DRVSTR_KEY(BRCM_CC_43143_CHIP_ID, 17): ^~~~ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3809:2: error: case label does not reduce to an integer constant case SDIOD_DRVSTR_KEY(BRCM_CC_43362_CHIP_ID, 13): ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: brcm80211-dev-list.pdl@broadcom.com Cc: netdev@vger.kernel.org Acked-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/Ykx0iRlvtBnKqtbG@zn.tnic Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 5d156e591b35..f7961b22e051 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -557,7 +557,7 @@ enum brcmf_sdio_frmtype { BRCMF_SDIO_FT_SUB, }; -#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu)) +#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | (pmu)) /* SDIO Pad drive strength to select value mappings */ struct sdiod_drive_str { -- 2.35.1