From patchwork Mon Aug 26 11:51:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Pietraszko X-Patchwork-Id: 11114377 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A290F13B1 for ; Mon, 26 Aug 2019 10:50:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5EE520828 for ; Mon, 26 Aug 2019 10:50:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="RTLvN7KC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5EE520828 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3ADD61668; Mon, 26 Aug 2019 12:49:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3ADD61668 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566816639; bh=aALr3k2ETKxHn1n0YD/pKcUphANgUkr8/aLv3V9szik=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RTLvN7KC3Aei4RymwkR9r701b6VMDwnxzR3Pta4k6GJl8tMitjgb5L/fbNSsP6vx+ gfAwJx8LzJCVPzAOIHfw8n/1PVC+zDKsEzq3XyGS5X/D+AJtBg9jhl0UVGRQlQE+wv YI1sYO0ABrGDjdtJVUdgTNRchak06EFYL8OMwsKE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A49E9F801ED; Mon, 26 Aug 2019 12:49:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 929B6F80362; Mon, 26 Aug 2019 12:49:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 742A1F801ED for ; Mon, 26 Aug 2019 12:49:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 742A1F801ED X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Aug 2019 03:49:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,431,1559545200"; d="scan'208";a="187561603" Received: from mpietra-desktop.igk.intel.com ([10.102.9.77]) by FMSMGA003.fm.intel.com with ESMTP; 26 Aug 2019 03:49:37 -0700 From: Marcin Pietraszko To: perex@perex.cz Date: Mon, 26 Aug 2019 13:51:41 +0200 Message-Id: <1566820301-18671-1-git-send-email-marcin.pietraszko@linux.intel.com> X-Mailer: git-send-email 2.7.4 Cc: alsa-devel@alsa-project.org, Marcin Pietraszko Subject: [alsa-devel] [PATCH 1/1] ASoC: topology: Fix variable overflow in split_format X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The 1 which was 32-bit long, when left-shifted by more than 31 caused an overflow, which resulted in some of the formats being not supported. Signed-off-by: Marcin Pietraszko --- src/topology/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topology/pcm.c b/src/topology/pcm.c index 5f586dc..00a35b9 100644 --- a/src/topology/pcm.c +++ b/src/topology/pcm.c @@ -321,7 +321,7 @@ static int split_format(struct snd_soc_tplg_stream_caps *caps, char *str) return -EINVAL; } - caps->formats |= 1 << format; + caps->formats |= 1ull << format; s = strtok(NULL, ", "); i++; }