Skip to contentSkip to conversation

pinctrl: s3c24xx: off by one in s3c24xx_eint_init()

PATCH In review Dan Carpenter 3 participants 3 messages Aug 27, 2013 – Aug 28, 2013

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

PATCH 1/1 pinctrl: s3c24xx: off by one in s3c24xx_eint_init()

If "irq = NUM_EINT" then it writes one space beyond the end of the eint_data->domains[] array.

drivers/pinctrl/pinctrl-s3c24xx.c +1 -1
index 24446da..ad3eaad 100644
@@ -549,7 +549,7 @@ static int s3c24xx_eint_init(struct samsung_pinctrl_drv_data *d)
 		irq = bank->eint_offset;
 		mask = bank->eint_mask;
 		for (pin = 0; mask; ++pin, mask >>= 1) {
-			if (irq > NUM_EINT)
+			if (irq >= NUM_EINT)
 				break;
 			if (!(mask & 1))
 				continue;
Reviewed-by on v1 1/1
#1 lore raw

Am Dienstag, 27. August 2013, 03:11:26 schrieb Dan Carpenter:

Quoted 2 lines

If "irq = NUM_EINT" then it writes one space beyond the end of the eint_data->domains[] array.

Thanks for catching this.

Quoted 1 line
Quoted 18 lines
(quoted diff) +0 -0

b/drivers/pinctrl/pinctrl-s3c24xx.c index 24446da..ad3eaad 100644

drivers/pinctrl/pinctrl-s3c24xx.c +1 -2
@@ -549,7 +549,7 @@ static int s3c24xx_eint_init(struct
 samsung_pinctrl_drv_data *d) irq = bank->eint_offset;
 		mask = bank->eint_mask;
 		for (pin = 0; mask; ++pin, mask >>= 1) {
-			if (irq > NUM_EINT)
+			if (irq >= NUM_EINT)
 				break;
 			if (!(mask & 1))
 				continue;
--

To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html