mirror of https://gitee.com/openkylin/linux.git
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:
parent
28b698b734
commit
eef08e5350
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue