[alsa-devel] [PATCH] ASoC: rcar: add ID check on rsnd_dai_get()
11 Oct
2013
11 Oct
'13
9:07 a.m.
checking id in rsnd_dai_get() is good idea
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/sh/rcar/core.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 28c24fc..b234ed6 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; }
--
1.7.9.5
4090
Age (days ago)
4090
Last active (days ago)
1 comments
2 participants
participants (2)
-
Kuninori Morimoto
-
Mark Brown