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
treewide: Use struct_size() for kmalloc()-family
[linux-2.6-microblaze.git]
/
drivers
/
input
/
input-leds.c
diff --git
a/drivers/input/input-leds.c
b/drivers/input/input-leds.c
index
5f04b2d
..
99cc784
100644
(file)
--- a/
drivers/input/input-leds.c
+++ b/
drivers/input/input-leds.c
@@
-98,8
+98,7
@@
static int input_leds_connect(struct input_handler *handler,
if (!num_leds)
return -ENXIO;
- leds = kzalloc(sizeof(*leds) + num_leds * sizeof(*leds->leds),
- GFP_KERNEL);
+ leds = kzalloc(struct_size(leds, leds, num_leds), GFP_KERNEL);
if (!leds)
return -ENOMEM;