Skip to content

Commit b5f3d7a

Browse files
Dan Carpenterbroonie
authored andcommitted
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 <dan.carpenter@oracle.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 6020779 commit b5f3d7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sh/rcar/scu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int rsnd_scu_set_route(struct rsnd_priv *priv,
6868
return 0;
6969

7070
id = rsnd_mod_id(mod);
71-
if (id < 0 || id > ARRAY_SIZE(routes))
71+
if (id < 0 || id >= ARRAY_SIZE(routes))
7272
return -EIO;
7373

7474
/*

0 commit comments

Comments
 (0)