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-Url: https://git.stricted.de/?a=commitdiff_plain;h=b5f3d7af286a28e2fcc92debaba40844cb32bfb4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 1ab1bce6be7f..5e46ef2e8bb8 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; /*