Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4407724ioa; Wed, 27 Apr 2022 03:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTH4Nx/mTwmO1yMBKtPpVMYTX1QlTeF0CKvqIvs6jtJvtFtc+GH78T4jidaOZD8Sxk/nj7 X-Received: by 2002:a17:90a:aa8b:b0:1d9:868c:b4c5 with SMTP id l11-20020a17090aaa8b00b001d9868cb4c5mr14268201pjq.198.1651054458574; Wed, 27 Apr 2022 03:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651054458; cv=none; d=google.com; s=arc-20160816; b=boSe6A28zUrpzCANZvhGp2VVNu/uBNOQUD0SDD2utTybULqLRPuw4Fu1N+4PKQz26x A2Nu53HMhrcS/BFDLYWTz5ELd3Tc8y0tCgX4dqac0asxbF0LRZu+KCXm+TYFX+WqrZ12 2FCqqJh594XjpPZYLFxJzuucc5tiHW0Gl5Y65KqQlHdS5lThyHCLxeg2XAScbc2/exyQ dL3kkUdUCexO2CeOKpdHG8q9BgRfMCdmhzdNXWD4TxKWOksiZ2a0h7ZBKGsYi3xVzNw9 L6PYqX8yTMjmE8+ljZiqJy+jRhslQ5sISw0Chy5GNlSxfbI6qqXm1sP6BTS53KSL5AHQ D8NQ== 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=4D9MEi6In3RJ//jyrzHMLZ5jRSwI/vzphxNj33JM0As=; b=fYGfhn33iLuvIkQhoDLWvpTp4yMbBH780Q8uayGSsPORRskD8qYH9RByI0CDXZodpp ZyGSvMWQmf5QutrFUordDNv7+zd2NwlT53Cw06MKo5a1z1X+FQKrPBfEAv1M7Zziw3H7 g8U2H2pYBaDR+A3OB5M/l62+qqcxbW3nDzDlQWYtrq+4yDiJEPQrSPmeiaXwaq1is15S FOytBXFfajR+oR5l2HoeERAcXueEzd5xa0tOcqOVj/TcfHcic7SpdGUONgsKQhFP9Yf/ 7qZkUp5EZmZO6vaUoHY6b78ftWz1oP7cqFX+X2ghxpzkHSEaMJzvPXZqVHi3m9L4eFPt WW9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iiWjWcdI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v19-20020a63f853000000b003aa8fffe77bsi1033366pgj.737.2022.04.27.03.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iiWjWcdI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2CDA261BCC; Wed, 27 Apr 2022 02:35:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347244AbiDZJKO (ORCPT + 99 others); Tue, 26 Apr 2022 05:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346695AbiDZIuQ (ORCPT ); Tue, 26 Apr 2022 04:50:16 -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 273A916FADE; Tue, 26 Apr 2022 01:38:43 -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 911EF60C2B; Tue, 26 Apr 2022 08:38:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E7A5C385B1; Tue, 26 Apr 2022 08:38:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962322; bh=Bzgv5WqWQfy17psL16EYWYKGoHPWRb79U3suFi4PhDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iiWjWcdIlIPcHkIaCMfZ/GVVe43xRDta37+kg7C82rRq3PssjAYJCjkGovI0IhN5v noxqYYMYhAz9C4BDK9IWK9KXElQeRVJQkYxb0yDiA9Sy74hRzaNcLtv37T6Xq5IZ6W RQ4V7GpBgcFfd2VaTuGXF6wpg4m4h5jinABLdMNQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Takashi Iwai , Sasha Levin Subject: [PATCH 5.15 057/124] ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant Date: Tue, 26 Apr 2022 10:20:58 +0200 Message-Id: <20220426081748.922713856@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=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 1ef8715975de8bd481abbd0839ed4f49d9e5b0ff ] Fix: sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’: sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant case USB_ID(0xfc08, 0x0101): /* Unknown vendor Cable */ ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. [ A slight correction with parentheses around the argument by tiwai ] Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220405151517.29753-3-bp@alien8.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/usbaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 167834133b9b..b8359a0aa008 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h @@ -8,7 +8,7 @@ */ /* handling of USB vendor/product ID pairs as 32-bit numbers */ -#define USB_ID(vendor, product) (((vendor) << 16) | (product)) +#define USB_ID(vendor, product) (((unsigned int)(vendor) << 16) | (product)) #define USB_ID_VENDOR(id) ((id) >> 16) #define USB_ID_PRODUCT(id) ((u16)(id)) -- 2.35.1