From: Dan Carpenter Date: Fri, 8 Nov 2013 09:46:10 +0000 (+0300) Subject: ASoC: rcar: off by one in rsnd_scu_set_route() X-Git-Tag: v3.13-rc1~2^2~2^2~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5f3d7af286a28e2fcc92debaba40844cb32bfb4;p=kernel%2Fkernel-generic.git ASoC: rcar: off by one in rsnd_scu_set_route() If "id == ARRAY_SIZE(routes)" then we read one space beyond the end of the routes[] array. Signed-off-by: Dan Carpenter Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c index 1ab1bce..5e46ef2 100644 --- a/sound/soc/sh/rcar/scu.c +++ b/sound/soc/sh/rcar/scu.c @@ -68,7 +68,7 @@ static int rsnd_scu_set_route(struct rsnd_priv *priv, return 0; id = rsnd_mod_id(mod); - if (id < 0 || id > ARRAY_SIZE(routes)) + if (id < 0 || id >= ARRAY_SIZE(routes)) return -EIO; /*