From: "Philippe Rétornaz" <philippe.retornaz@epfl.ch>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org, Richard Purdie <rpurdie@rpsys.net>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] leds: mc13783: fix off-by-one for checking num_leds
Date: Mon, 12 Dec 2011 10:45:28 +0100 [thread overview]
Message-ID: <2041769.UEZ0VI7T2U@laptop> (raw)
In-Reply-To: <1323501296.2539.2.camel@phoenix>
Le samedi 10 décembre 2011 15:14:56 Axel Lin a écrit :
> The LED id is begin from 0.
> Thus the maximum number of leds should be MC13783_LED_MAX + 1.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> drivers/leds/leds-mc13783.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
> index c61e8c4..8bc4915 100644
> --- a/drivers/leds/leds-mc13783.c
> +++ b/drivers/leds/leds-mc13783.c
> @@ -275,7 +275,7 @@ static int __devinit mc13783_led_probe(struct
> platform_device *pdev) return -ENODEV;
> }
>
> - if (pdata->num_leds < 1 || pdata->num_leds > MC13783_LED_MAX) {
> + if (pdata->num_leds < 1 || pdata->num_leds > (MC13783_LED_MAX + 1)) {
> dev_err(&pdev->dev, "Invalid led count %d\n", pdata->num_leds);
> return -EINVAL;
> }
Acked-by: Philippe Retornaz <philippe.retornaz@epfl.ch>
Thanks !
Philippe
prev parent reply other threads:[~2011-12-12 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-10 7:14 [PATCH] leds: mc13783: fix off-by-one for checking num_leds Axel Lin
2011-12-12 9:45 ` Philippe Rétornaz [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=2041769.UEZ0VI7T2U@laptop \
--to=philippe.retornaz@epfl.ch \
--cc=akpm@linux-foundation.org \
--cc=axel.lin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox