Commit f3278e3f authored by Kees Cook's avatar Kees Cook

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)
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;
......
Markdown is supported
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