summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-06-12 01:31:49 +0200
committerKees Cook <keescook@chromium.org>2018-06-13 01:19:22 +0200
commitf3278e3f0ac42d07902d9a29d259eab7e108108a (patch)
treec0334fc6453d7dd3ca93071f36bb15fc0d037dd3
parentConvert intel uncore to struct_size (diff)
downloadlinux-f3278e3f0ac42d07902d9a29d259eab7e108108a.tar.xz
linux-f3278e3f0ac42d07902d9a29d259eab7e108108a.zip
leds: Use struct_size() in allocation
This case got missed by the earlier treewide struct_size() conversions. Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r--drivers/leds/leds-cr0014114.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c
index a4b1c1dcce7f..0e4262462cb9 100644
--- 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;