projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
led: gpio: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
[linux-2.6-microblaze.git]
/
drivers
/
leds
/
leds-gpio-register.c
diff --git
a/drivers/leds/leds-gpio-register.c
b/drivers/leds/leds-gpio-register.c
index
fbd8934
..
75717ba
100644
(file)
--- a/
drivers/leds/leds-gpio-register.c
+++ b/
drivers/leds/leds-gpio-register.c
@@
-28,6
+28,9
@@
struct platform_device *__init gpio_led_register_device(
struct platform_device *ret;
struct gpio_led_platform_data _pdata = *pdata;
+ if (!pdata->num_leds)
+ return ERR_PTR(-EINVAL);
+
_pdata.leds = kmemdup(pdata->leds,
pdata->num_leds * sizeof(*pdata->leds), GFP_KERNEL);
if (!_pdata.leds)