ASoC: rcar: off by one in rsnd_scu_set_route()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Nov 2013 09:46:10 +0000 (12:46 +0300)
committerMark Brown <broonie@linaro.org>
Tue, 19 Nov 2013 19:07:07 +0000 (19:07 +0000)
If "id == ARRAY_SIZE(routes)" then we read one space beyond the end of
the routes[] array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/sh/rcar/scu.c

index 1ab1bce..5e46ef2 100644 (file)
@@ -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;
 
        /*