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 <>
parent 6566f907
......@@ -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),
if (!priv)
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