From: Ranjith Lohithakshan <ranjithl@ti.com>
To: Rick Ball <rball@AESAustin.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Bug in omap3evm.c?
Date: Wed, 12 May 2010 19:34:00 +0530 [thread overview]
Message-ID: <4BEAB550.9000502@ti.com> (raw)
In-Reply-To: <4B8557E2E5753944B2BB2E52F7C2A30C02C6DA1A@MAIL.AES.local>
On Tue, 11-May-10 4:38 AM +0530, Rick Ball wrote:
> I think I've found a small problem in the board-omap3evm.c file under arch/arm/mach-omap2 (support for the TI/Mistral OMAP35x EVM board).
>
> What I noticed is that the declaration for the array gpio_leds is initialized with one element (at line 380):
>
> static struct gpio_led gpio_leds[] = {
> {
> .name = "omap3evm::ledb",
> /* normally not visible (board underside) */
> .default_trigger = "default-on",
> .gpio = -EINVAL, /* gets replaced */
> .active_low = true,
> },
> };
>
> But then down at line 430 element 2 is set:
>
> /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
> gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
>
> How did the array end up with 3 elements so that 2 would be a valid index? It looks to me like it wouldn't flag an error, but would corrupt memory. I'd submit a patch, but I'm not sure what this code was attempting to do...
This appears to be like a bug. Possibly there would have been some
entries earlier which got removed, but the indexing done in the code
never got updated.
- Ranjith
prev parent reply other threads:[~2010-05-12 14:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-10 23:08 Bug in omap3evm.c? Rick Ball
2010-05-12 14:04 ` Ranjith Lohithakshan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BEAB550.9000502@ti.com \
--to=ranjithl@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=rball@AESAustin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.