diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-cr0014114.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c index a4b1c1d..0e42624 100644 --- a/drivers/leds/leds-cr0014114.c +++ b/drivers/leds/leds-cr0014114.c @@ -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; |