summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-10-11 00:07:48 -0700
committerMark Brown <broonie@linaro.org>2013-10-11 19:45:49 +0100
commit2192f81c53a7879c803f0f7d6c49645fdf6c2f6a (patch)
tree4d2b7da03f65cb1920c09a2e7b1c6ae5c324b42c /sound/soc/sh
parent740ad6c328823f066efb8b907576a54ef92aca69 (diff)
downloadlinux-2192f81c53a7879c803f0f7d6c49645fdf6c2f6a.tar.bz2
ASoC: rcar: add ID check on rsnd_dai_get()
checking id in rsnd_dai_get() is good idea Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/rcar/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 28c24fcf8bc7..b234ed663073 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -318,6 +318,9 @@ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai)
struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id)
{
+ if ((id < 0) || (id >= rsnd_dai_nr(priv)))
+ return NULL;
+
return priv->rdai + id;
}