alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH 5/8] ASoC: sh: rcar: ctu: add  missing error check
Date: Fri, 19 Feb 2021 17:16:32 -0600	[thread overview]
Message-ID: <20210219231635.5749-6-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20210219231635.5749-1-pierre-louis.bossart@linux.intel.com>

cppcheck warning:

sound/soc/sh/rcar/ctu.c:212:6: style: Variable 'ret' is reassigned a
value before the old one has been used. [redundantAssignment]
 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV0",
     ^
sound/soc/sh/rcar/ctu.c:205:6: note: ret is assigned
 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU Pass",
     ^
sound/soc/sh/rcar/ctu.c:212:6: note: ret is overwritten
 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV0",
     ^

All the kcontrol creations are checked for errors, except for one. Add
the missing error check.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sh/rcar/ctu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c
index 7647b3d4c0ba..20eecd088d13 100644
--- a/sound/soc/sh/rcar/ctu.c
+++ b/sound/soc/sh/rcar/ctu.c
@@ -207,6 +207,8 @@ static int rsnd_ctu_pcm_new(struct rsnd_mod *mod,
 			       NULL,
 			       &ctu->pass, RSND_MAX_CHANNELS,
 			       0xC);
+	if (ret < 0)
+		return ret;
 
 	/* ROW0 */
 	ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV0",
-- 
2.25.1


  parent reply	other threads:[~2021-02-19 23:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 23:16 [PATCH 0/8] ASoC: sh: remove cppcheck warnings Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 1/8] ASoC: sh: dma-sh7760: remove unused variable Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 2/8] ASoC: sh: rcar: align function prototypes Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 3/8] ASoC: sh: rcar: simplify return Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 4/8] ASoC: sh: rcar: core: rename shadowing variables Pierre-Louis Bossart
2021-02-21 23:27   ` Kuninori Morimoto
2021-02-22 15:41     ` Pierre-Louis Bossart
2021-02-24 23:13       ` Kuninori Morimoto
2021-02-19 23:16 ` Pierre-Louis Bossart [this message]
2021-02-19 23:16 ` [PATCH 6/8] ASoC: sh: rcar: ssi: remove redundant assignment Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 7/8] ASoC: sh: siu_pcm: remove useless assignment Pierre-Louis Bossart
2021-02-19 23:16 ` [PATCH 8/8] ASoC: sh: siu_pcm: remove unused variable Pierre-Louis Bossart
2021-02-21 23:32 ` [PATCH 0/8] ASoC: sh: remove cppcheck warnings Kuninori Morimoto
2021-03-01 23:34 ` (subset) " Mark Brown

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=20210219231635.5749-6-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=tiwai@suse.de \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).