summaryrefslogtreecommitdiff
path: root/drivers/input/input-leds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/input-leds.c')
-rw-r--r--drivers/input/input-leds.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/input-leds.c b/drivers/input/input-leds.c
index 5f04b2d94635..99cc784e1264 100644
--- 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;