diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2022-04-21 04:55:58 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-21 16:53:15 +0200 |
commit | d09a7db431c65aaa8303eb456439d1831ca2e6b4 (patch) | |
tree | 847bb18e2b788abb8fcba302ddd2d8588bd3c08f /sound/soc/sh/rcar/src.c | |
parent | ASoC: audio-graph-card2: indicate "Experimental stage" warning only when succ... (diff) | |
download | linux-d09a7db431c65aaa8303eb456439d1831ca2e6b4.tar.xz linux-d09a7db431c65aaa8303eb456439d1831ca2e6b4.zip |
ASoC: rsnd: care return value from rsnd_node_fixed_index()
Renesas Sound is very complex, and thus it needs to use
rsnd_node_fixed_index() to know enabled pin index.
It returns error if strange pin was selected,
but some codes didn't check it.
This patch 1) indicates error message, 2) check return
value.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmlbgn5t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/src.c')
-rw-r--r-- | sound/soc/sh/rcar/src.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 42a100c6303d..0ea84ae57c6a 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -676,7 +676,12 @@ int rsnd_src_probe(struct rsnd_priv *priv) if (!of_device_is_available(np)) goto skip; - i = rsnd_node_fixed_index(np, SRC_NAME, i); + i = rsnd_node_fixed_index(dev, np, SRC_NAME, i); + if (i < 0) { + ret = -EINVAL; + of_node_put(np); + goto rsnd_src_probe_done; + } src = rsnd_src_get(priv, i); |