projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
740ad6c
)
ASoC: rcar: add ID check on rsnd_dai_get()
author
Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com>
Fri, 11 Oct 2013 07:07:48 +0000
(
00:07
-0700)
committer
Mark Brown
<broonie@linaro.org>
Fri, 11 Oct 2013 18:45:49 +0000
(19:45 +0100)
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>
sound/soc/sh/rcar/core.c
patch
|
blob
|
history
diff --git
a/sound/soc/sh/rcar/core.c
b/sound/soc/sh/rcar/core.c
index
28c24fc
..
b234ed6
100644
(file)
--- 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;
}