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>
This commit is contained in:
parent
6566f907bf
commit
f3278e3f0a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user