projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6d511e
)
drivers/leds/leds-mc13783.c: fix off-by-one for checking num_leds
author
Axel Lin
<
[email protected]
>
Tue, 10 Jan 2012 23:09:43 +0000
(15:09 -0800)
committer
Linus Torvalds
<
[email protected]
>
Wed, 11 Jan 2012 00:30:49 +0000
(16:30 -0800)
The LED id begins from 0. Thus the maximum number of leds should be
MC13783_LED_MAX + 1.
Signed-off-by: Axel Lin <
[email protected]
>
Acked-by: Philippe Retornaz <
[email protected]
>
Cc: Richard Purdie <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/leds/leds-mc13783.c
patch
|
blob
|
history
diff --git
a/drivers/leds/leds-mc13783.c
b/drivers/leds/leds-mc13783.c
index c61e8c4f54694ddb1e7ca3b98a0f1967b8e3393c..8bc4915415509d6e2456a0d4ea46446bf9188eca 100644
(file)
--- 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;
}