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

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
...@@ -255,7 +255,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip, ...@@ -255,7 +255,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip,
if (ret < 0) if (ret < 0)
goto out; goto out;
chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL); chip->pwms = kcalloc(chip->npwm, sizeof(*pwm), GFP_KERNEL);
if (!chip->pwms) { if (!chip->pwms) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment