Skip to content

Commit

Permalink
ASoC: rcar: off by one in rsnd_scu_set_route()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Nov 19, 2013
1 parent 6020779 commit b5f3d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/scu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit b5f3d7a

Please sign in to comment.