Skip to contentSkip to conversation

OMAP3 EVM: remove out-of-bounds array access of gpio_leds.

PATCH In review Arnout Vandecappelle (Essensium/Mind) 2 participants 2 messages Feb 13, 2012 – Feb 21, 2012

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

PATCH 1/1 OMAP3 EVM: remove out-of-bounds array access of gpio_leds.

From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]>

The omap3evm BSP enables a GPIO LED on the twl4030 chip. However, the static gpio_leds array doesn't have an entry for it. This is most likely a copy-and-paste error, because it has been in there since the first commit of the omap3evm BSP (53c5ec31).

---
Please CC me, I'm not on the list.

Since I don't have access to an OMAP3EVM board or schematics, I couldn't actually test if my fix is correct. I discovered the error because I'm using this BSP for an AM37xEVM board - which has the LED connected to a different GPIO. It works on the AM37xEVM board if I replace the assignment with the correct GPIO number (8).

---
 arch/arm/mach-omap2/board-omap3evm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +1 -1
index ec00b2e..f6f5cd4 100644
@@ -381,7 +381,7 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
 	gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
 
 	/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
-	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+	gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
 	platform_device_register(&leds_gpio);
 
Signature · 1 line
1.7.8.3
maintainer
#1 lore raw
Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)

From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]>

The omap3evm BSP enables a GPIO LED on the twl4030 chip. However, the static gpio_leds array doesn't have an entry for it. This is most likely a copy-and-paste error, because it has been in there since the first commit of the omap3evm BSP (53c5ec31).

Quoted 8 lines

---
Please CC me, I'm not on the list.

Since I don't have access to an OMAP3EVM board or schematics, I couldn't actually test if my fix is correct. I discovered the error because I'm using this BSP for an AM37xEVM board - which has the LED connected to a different GPIO. It works on the AM37xEVM board if I replace the assignment with the correct GPIO number (8).

Thanks, applying it into fixes.

Regards,

Tony