From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AA82C433E0 for ; Fri, 8 Jan 2021 12:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C427239FC for ; Fri, 8 Jan 2021 12:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726662AbhAHMgj (ORCPT ); Fri, 8 Jan 2021 07:36:39 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:44625 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbhAHMgj (ORCPT ); Fri, 8 Jan 2021 07:36:39 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kxqza-0005Ut-MN; Fri, 08 Jan 2021 12:35:46 +0000 From: Colin King To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?UTF-8?q?=E6=9C=B1=E7=81=BF=E7=81=BF?= , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] ASoC: soc-pcm: Fix uninitialised return value in variable ret Date: Fri, 8 Jan 2021 12:35:46 +0000 Message-Id: <20210108123546.19601-1-colin.king@canonical.com> X-Mailer: git-send-email 2.29.2 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: Colin Ian King Currently when attempting to start the BE fails because the FE is not started the error return variable ret is not initialized and garbage is returned. Fix this by setting it to 0 so the caller does not report the error "ASoC: failed to shutdown some BEs" and because this failure path has already reported the reason for the early return. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 2c1382840c19 ("ASoC: soc-pcm: disconnect BEs if the FE is not ready") Signed-off-by: Colin Ian King --- sound/soc/soc-pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 481a4a25acb0..b787ce4ceb5a 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2443,6 +2443,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) fe->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) { dev_err(fe->dev, "ASoC: FE %s is not ready %d\n", fe->dai_link->name, fe->dpcm[stream].state); + ret = 0; goto disconnect; } -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Colin King Date: Fri, 08 Jan 2021 12:35:46 +0000 Subject: [PATCH][next] ASoC: soc-pcm: Fix uninitialised return value in variable ret Message-Id: <20210108123546.19601-1-colin.king@canonical.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?UTF-8?q?=E6=9C=B1=E7=81=BF=E7=81=BF?= , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Colin Ian King Currently when attempting to start the BE fails because the FE is not started the error return variable ret is not initialized and garbage is returned. Fix this by setting it to 0 so the caller does not report the error "ASoC: failed to shutdown some BEs" and because this failure path has already reported the reason for the early return. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 2c1382840c19 ("ASoC: soc-pcm: disconnect BEs if the FE is not ready") Signed-off-by: Colin Ian King --- sound/soc/soc-pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 481a4a25acb0..b787ce4ceb5a 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2443,6 +2443,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE) { dev_err(fe->dev, "ASoC: FE %s is not ready %d\n", fe->dai_link->name, fe->dpcm[stream].state); + ret = 0; goto disconnect; } -- 2.29.2