ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data()

The q6asm_fe_dais[] array has MAX_SESSIONS (8) elements so the >
comparison should be >= or we access one element beyond the end of the
array.

Fixes: 22930c79ac ("ASoC: qdsp6: q6asm-dai: Add support to compress offload")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2018-12-21 12:04:42 +03:00 committed by Mark Brown
parent 28b698b734
commit eef08e5350
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 1 deletions

View File

@ -874,7 +874,7 @@ static int of_q6asm_parse_dai_data(struct device *dev,
for_each_child_of_node(dev->of_node, node) { for_each_child_of_node(dev->of_node, node) {
ret = of_property_read_u32(node, "reg", &id); ret = of_property_read_u32(node, "reg", &id);
if (ret || id > MAX_SESSIONS || id < 0) { if (ret || id >= MAX_SESSIONS || id < 0) {
dev_err(dev, "valid dai id not found:%d\n", ret); dev_err(dev, "valid dai id not found:%d\n", ret);
continue; continue;
} }