mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
leds: Use struct_size() in allocation
This case got missed by the earlier treewide struct_size() conversions. Signed-off-by: Kees Cook <[email protected]>
This commit is contained in:
parent
6566f907bf
commit
f3278e3f0a
1 changed files with 1 additions and 2 deletions
|
|
@ -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 a new issue