Skip to contentSkip to conversation

beyond ARRAY_SIZE of s3c64xx_i2s

PATCH In review Roel Kluin 2 participants 3 messages May 20, 2009 – May 21, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 beyond ARRAY_SIZE of s3c64xx_i2s

Do not go beyond ARRAY_SIZE of s3c64xx_i2s

---
In this case you are Maintainer, correct?

sound/soc/s3c24xx/s3c64xx-i2s.c +1 -1
index 33c5de7..f2d3021 100644
@@ -126,7 +126,7 @@ static int s3c64xx_i2s_probe(struct platform_device *pdev,
 
 	dev_dbg(dev, "%s: probing dai %d\n", __func__, pdev->id);
 
-	if (pdev->id < 0 || pdev->id > ARRAY_SIZE(s3c64xx_i2s)) {
+	if (pdev->id < 0 || pdev->id >= ARRAY_SIZE(s3c64xx_i2s)) {
 		dev_err(dev, "id %d out of range\n", pdev->id);
 		return -EINVAL;
 	}
#1 lore raw
Quoted 3 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of s3c64xx_i2s

Looks good, I'll apply this.

Quoted 2 lines

---
In this case you are Maintainer, correct?

Yes, for anything in sound/soc.

#2 lore raw
Quoted 6 lines · Mark Brown
Quoted 3 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of s3c64xx_i2s

Looks good, I'll apply this.

...or not, since it doesn't apply against current ALSA and the issue has been fixed in a different way already. I guess you're running some sort of script looking for these issues, probably against current mainline? It might be worth considering running against -next instead since that will ensure that your patches apply more easily to people's current development trees, or checking your results against -next to see if the issue is still present.