diff options
author | Kees Cook <keescook@chromium.org> | 2018-10-05 19:21:46 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-10-05 21:06:30 -0400 |
commit | 329e09893909d409039f6a79757d9b80b67efe39 (patch) | |
tree | d83759b28dcc8760167ed7c082d5846f63a55d2d /drivers/hwmon/npcm750-pwm-fan.c | |
parent | 57361846b52bc686112da6ca5368d11210796804 (diff) |
treewide: Replace more open-coded allocation size multiplications
As done treewide earlier, this catches several more open-coded
allocation size calculations that were added to the kernel during the
merge window. This performs the following mechanical transformations
using Coccinelle:
kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...)
kvzalloc(a * b, ...) -> kvcalloc(a, b, ...)
devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...)
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/hwmon/npcm750-pwm-fan.c')
-rw-r--r-- | drivers/hwmon/npcm750-pwm-fan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c index 8474d601aa63..b998f9fbed41 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c | |||
@@ -908,7 +908,7 @@ static int npcm7xx_en_pwm_fan(struct device *dev, | |||
908 | if (fan_cnt < 1) | 908 | if (fan_cnt < 1) |
909 | return -EINVAL; | 909 | return -EINVAL; |
910 | 910 | ||
911 | fan_ch = devm_kzalloc(dev, sizeof(*fan_ch) * fan_cnt, GFP_KERNEL); | 911 | fan_ch = devm_kcalloc(dev, fan_cnt, sizeof(*fan_ch), GFP_KERNEL); |
912 | if (!fan_ch) | 912 | if (!fan_ch) |
913 | return -ENOMEM; | 913 | return -ENOMEM; |
914 | 914 | ||