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>
This commit is contained in:
Kuninori Morimoto 2013-10-11 00:07:48 -07:00 committed by Mark Brown
parent 740ad6c328
commit 2192f81c53

View file

@ -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;
}