Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2907f8ab authored by Thierry Reding's avatar Thierry Reding
Browse files

pwm: Use kcalloc() instead of kzalloc()



kcalloc() should be preferred for allocations of arrays over kzalloc()
with multiplication.

Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 83a98864
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip,
	if (ret < 0)
		goto out;

	chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL);
	chip->pwms = kcalloc(chip->npwm, sizeof(*pwm), GFP_KERNEL);
	if (!chip->pwms) {
		ret = -ENOMEM;
		goto out;