Skip to contentSkip to conversation

radio-bcm2048.c: fix wrong overflow check

PATCH New Pavel Machek 1 participant 1 message Apr 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 radio-bcm2048.c: fix wrong overflow check

From: Pali Rohár <[email protected]>

Fix wrong overflow check in radio-bcm2048.

---

Nothing in patch changed, just added CCs, and From/Reported-by headers.

drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
index b2cd3a8..bbf236e 100644
@@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
 	int err;
 	u32 new_frequency = 0;
 
-	if (region > ARRAY_SIZE(region_configs))
+	if (region >= ARRAY_SIZE(region_configs))
 		return -EINVAL;
 
 	mutex_lock(&bdev->mutex);
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html