public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data()
@ 2018-12-21  9:04 Dan Carpenter
  2018-12-21  9:05 ` [PATCH 2/2] ASoC: qdsp6: q6asm-dai: Fix a NULL vs IS_ERR() bug Dan Carpenter
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Dan Carpenter @ 2018-12-21  9:04 UTC (permalink / raw)
  To: Patrick Lai, Srinivas Kandagatla
  Cc: alsa-devel, Banajit Goswami, kernel-janitors, Takashi Iwai,
	Liam Girdwood, Vinod Koul, Mark Brown

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: 22930c79ac5c ("ASoC: qdsp6: q6asm-dai: Add support to compress offload")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index 5b986b74dd36..9d738b4c1e05 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -874,7 +874,7 @@ static int of_q6asm_parse_dai_data(struct device *dev,
 
 	for_each_child_of_node(dev->of_node, node) {
 		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);
 			continue;
 		}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-12-21 13:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-21  9:04 [PATCH 1/2] ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data() Dan Carpenter
2018-12-21  9:05 ` [PATCH 2/2] ASoC: qdsp6: q6asm-dai: Fix a NULL vs IS_ERR() bug Dan Carpenter
2018-12-21 12:29   ` Srinivas Kandagatla
2018-12-21 13:42   ` Applied "ASoC: qdsp6: q6asm-dai: Fix a NULL vs IS_ERR() bug" to the asoc tree Mark Brown
2018-12-21  9:06 ` [PATCH 3/4] ASoC: qdsp6: q6asm-dai: Fix a small memory leak Dan Carpenter
2018-12-21 12:29   ` [alsa-devel] " Srinivas Kandagatla
2018-12-21 13:42   ` Applied "ASoC: qdsp6: q6asm-dai: Fix a small memory leak" to the asoc tree Mark Brown
2018-12-21  9:06 ` [PATCH 4/4] ALSA: compress: prevent potential divide by zero bugs Dan Carpenter
2018-12-21 13:42   ` Applied "ALSA: compress: prevent potential divide by zero bugs" to the asoc tree Mark Brown
2018-12-21 12:31 ` [PATCH 1/2] ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data() Srinivas Kandagatla
2018-12-21 13:42 ` Applied "ASoC: qdsp6: q6asm-dai: Off by one in of_q6asm_parse_dai_data()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox