mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 11:50:52 +07:00
pwm: Use kcalloc() instead of kzalloc()
kcalloc() should be preferred for allocations of arrays over kzalloc() with multiplication. Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
83a98864ff
commit
2907f8abb7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user