Skip to content

Commit

Permalink
ASoC: rcar: add ID check on rsnd_dai_get()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Oct 11, 2013
1 parent 740ad6c commit 2192f81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2192f81

Please sign in to comment.