提交 2192f81c 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

ASoC: rcar: add ID check on rsnd_dai_get()

checking id in rsnd_dai_get() is good idea
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 740ad6c3
...@@ -318,6 +318,9 @@ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai) ...@@ -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) 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; return priv->rdai + id;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册