Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: ns2: Slightly simplify a memory allocation

Use devm_kcalloc() instead of devm_kzalloc()+array_size().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/560b8f140c19a7da40f5e9540c3ef312969b0dc4.1690057595.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Christophe JAILLET and committed by
Lee Jones
c8a03943 3192f141

+1 -1
+1 -1
drivers/leds/leds-ns2.c
··· 247 247 if (!count) 248 248 return -ENODEV; 249 249 250 - leds = devm_kzalloc(dev, array_size(sizeof(*leds), count), GFP_KERNEL); 250 + leds = devm_kcalloc(dev, count, sizeof(*leds), GFP_KERNEL); 251 251 if (!leds) 252 252 return -ENOMEM; 253 253