summaryrefslogtreecommitdiff
path: root/drivers/pwm/core.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2016-05-02 13:07:34 +0300
committerThierry Reding <thierry.reding@gmail.com>2016-05-03 14:57:05 +0300
commit2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc (patch)
tree0bd9a54686209b0ae81db58c4888a79f15a7370f /drivers/pwm/core.c
parent83a98864ff62b23dfa93baeaaf340741e263c02b (diff)
downloadlinux-2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc.tar.xz
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>
Diffstat (limited to 'drivers/pwm/core.c')
-rw-r--r--drivers/pwm/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index bc0c20ac90a1..2a1a2d566e39 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -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;