Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4623945pxj; Wed, 12 May 2021 09:28:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2lamcbkB7Sas+3eGUJ5FcmVyhXy9EfJwAyovSOEa8uS+Wlv4hPIwsCELmqs4APxmgj42a X-Received: by 2002:a17:906:cc8b:: with SMTP id oq11mr38089790ejb.520.1620836905131; Wed, 12 May 2021 09:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836905; cv=none; d=google.com; s=arc-20160816; b=GntahII+BbDrFylwwmYjnTgD9IfjdFUDFYvm8wO88UoMLfkflZ6pI7RvNol2q3YHJU z8dOngNMqPNBn3Ntd/1GG1BmldidEFYy2gwINeS5pJ2dh3w7SKiBvEJgiMfPNBbmV+23 kL6vXDzk43VHQ6msERKFpXXtnzfcwHbdMmLCK45+ucAQV8Cc2+4Z0EdT5q03hXKwtDN0 AHBDQ+cabK+54aukOLHBwYV8XvNZ7D4nyXDoS3NNM0H+vNQVDW5GaXWK7Yui5Ai7pUzg yp02ltKJbuo/sYwGkwVtKgJEMg7S3N/w6G90A8tMeO+rpZ0hDvqGFjJ5PbLEUTJSBcL6 qOFQ== 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=bSZfrVsYUHuzsOHS4dzNHjmQS6Uz+cuUTMzFeEnsWFU=; b=nbVk6epqncskjMtmT1MAunMTrnn7AeF+DRRWsEonVogcsrVnPtHcuCBy2m5R5VtQeQ s6VkECQoykcDPXRlUyzj7NQVBDe2Vc7W71CTXpV9rsjmmM8n8IbL8EliqODaHCVPKrB8 ZpVZgGLMWWpXbZMZeN64VdfvtrMKLNMer2jx7qYob3xoFREin4Mos4Cx1Msi4qg5nT2o O/18jswAVF5v3IJtP/ZQhjqQ2uFvfs8P6JpsgyxEynAw2eR+Vdyvcc33Y1iOJg/8VIgC KjfvwAZvhJjhB+6a8GiqANMAb0XngSUbi1p8RXuV1uTuaA+GbtYdwkpHi9atJ3FNxD36 fAsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xn915FOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si281320ejr.730.2021.05.12.09.28.00; Wed, 12 May 2021 09:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xn915FOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239518AbhELQYz (ORCPT + 99 others); Wed, 12 May 2021 12:24:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:57176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236253AbhELPhY (ORCPT ); Wed, 12 May 2021 11:37:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 848DB61C56; Wed, 12 May 2021 15:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832737; bh=CChuXkP7aLB9HAgQw/bHi20uN6QPiSKUkRMriHKorp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xn915FOzSmIsKDjE1O9y/4y+mayvhuJvaiOiwQOxrwe3QAJMXkdVCY+u4z900nIU3 ZhXkJFJV3Ki/ayDmHW8Rg8VSU8f0TQQvsRJXN1e06+civaeW5r0+paBo+X9DD82d6J lRFAoa3CJPZZkmmTv72Y9BfDVt7j69+S+3L9u2To= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sameer Pujar , Mark Brown , Sasha Levin Subject: [PATCH 5.10 401/530] ASoC: simple-card: fix possible uninitialized single_cpu local variable Date: Wed, 12 May 2021 16:48:31 +0200 Message-Id: <20210512144832.946618856@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit fa74c223b6fd78a5314b4c61b9abdbed3c2185b4 ] The 'single_cpu' local variable is assigned by asoc_simple_parse_dai() and later used in a asoc_simple_canonicalize_cpu() call, assuming the entire function did not exit on errors. However the first function returns 0 if passed device_node is NULL, thus leaving the variable uninitialized and reporting success. Addresses-Coverity: Uninitialized scalar variable Fixes: 8f7f298a3337 ("ASoC: simple-card-utils: separate asoc_simple_card_parse_dai()") Signed-off-by: Krzysztof Kozlowski Acked-by: Sameer Pujar Link: https://lore.kernel.org/r/20210407092027.60769-1-krzysztof.kozlowski@canonical.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/simple-card.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 97b4f5480a31..0c640308ed80 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -340,7 +340,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, struct device_node *top = dev->of_node; struct asoc_simple_dai *cpu_dai; struct asoc_simple_dai *codec_dai; - int ret, single_cpu; + int ret, single_cpu = 0; /* Do it only CPU turn */ if (!li->cpu) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 75365c7bb393..d916ec69c24f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -258,7 +258,7 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, struct device_node *plat = NULL; char prop[128]; char *prefix = ""; - int ret, single_cpu; + int ret, single_cpu = 0; /* * |CPU |Codec : turn -- 2.30.2