projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6566f90
)
leds: Use struct_size() in allocation
author
Kees Cook
<keescook@chromium.org>
Mon, 11 Jun 2018 23:31:49 +0000
(16:31 -0700)
committer
Kees Cook
<keescook@chromium.org>
Tue, 12 Jun 2018 23:19:22 +0000
(16:19 -0700)
This case got missed by the earlier treewide struct_size() conversions.
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/leds/leds-cr0014114.c
patch
|
blob
|
history
diff --git
a/drivers/leds/leds-cr0014114.c
b/drivers/leds/leds-cr0014114.c
index
a4b1c1d
..
0e42624
100644
(file)
--- a/
drivers/leds/leds-cr0014114.c
+++ b/
drivers/leds/leds-cr0014114.c
@@
-237,8
+237,7
@@
static int cr0014114_probe(struct spi_device *spi)
return -ENODEV;
}
- priv = devm_kzalloc(&spi->dev,
- sizeof(*priv) + sizeof(*priv->leds) * count,
+ priv = devm_kzalloc(&spi->dev, struct_size(priv, leds, count),
GFP_KERNEL);
if (!priv)
return -ENOMEM;