Commit f3278e3f authored by Kees Cook's avatar Kees Cook
Browse files

leds: Use struct_size() in allocation



This case got missed by the earlier treewide struct_size() conversions.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 6566f907
...@@ -237,8 +237,7 @@ static int cr0014114_probe(struct spi_device *spi) ...@@ -237,8 +237,7 @@ static int cr0014114_probe(struct spi_device *spi)
return -ENODEV; return -ENODEV;
} }
priv = devm_kzalloc(&spi->dev, priv = devm_kzalloc(&spi->dev, struct_size(priv, leds, count),
sizeof(*priv) + sizeof(*priv->leds) * count,
GFP_KERNEL); GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment