diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2016-05-02 12:07:34 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-05-03 13:57:05 +0200 |
commit | 2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc (patch) | |
tree | 0bd9a54686209b0ae81db58c4888a79f15a7370f /drivers/pwm | |
parent | 83a98864ff62b23dfa93baeaaf340741e263c02b (diff) | |
download | linux-2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc.tar.bz2 |
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')
-rw-r--r-- | drivers/pwm/core.c | 2 |
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; |