From: Colin King <colin.king@canonical.com> To: "Liam Girdwood" <lgirdwood@gmail.com>, "Mark Brown" <broonie@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai" <tiwai@suse.com>, 朱灿灿 <zhucancan@vivo.com>, 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 [thread overview] Message-ID: <20210108123546.19601-1-colin.king@canonical.com> (raw) From: Colin Ian King <colin.king@canonical.com> 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 <colin.king@canonical.com> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: Colin King <colin.king@canonical.com> To: "Liam Girdwood" <lgirdwood@gmail.com>, "Mark Brown" <broonie@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai" <tiwai@suse.com>, 朱灿灿 <zhucancan@vivo.com>, 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, 08 Jan 2021 12:35:46 +0000 [thread overview] Message-ID: <20210108123546.19601-1-colin.king@canonical.com> (raw) From: Colin Ian King <colin.king@canonical.com> 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 <colin.king@canonical.com> --- 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
next reply other threads:[~2021-01-08 12:36 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-08 12:35 Colin King [this message] 2021-01-08 12:35 ` [PATCH][next] ASoC: soc-pcm: Fix uninitialised return value in variable ret Colin King 2021-01-11 9:56 ` 朱灿灿 2021-01-11 16:35 ` [PATCH][next] " Mark Brown 2021-01-11 16:35 ` Mark Brown 2021-01-11 17:07 ` Colin Ian King 2021-01-11 17:07 ` Colin Ian King 2021-01-11 17:09 ` Mark Brown 2021-01-11 17:09 ` Mark Brown 2021-01-11 17:37 ` Colin Ian King 2021-01-11 17:37 ` Colin Ian King 2021-01-11 17:58 ` Mark Brown 2021-01-11 17:58 ` Mark Brown 2021-01-12 10:22 ` Dan Carpenter 2021-01-12 10:22 ` Dan Carpenter 2021-01-12 10:22 ` Dan Carpenter 2021-01-12 10:24 ` Colin Ian King 2021-01-12 10:24 ` Colin Ian King
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210108123546.19601-1-colin.king@canonical.com \ --to=colin.king@canonical.com \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=kernel-janitors@vger.kernel.org \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=perex@perex.cz \ --cc=tiwai@suse.com \ --cc=zhucancan@vivo.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.