]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/hwmon/gpio-fan.c
treewide: devm_kzalloc() -> devm_kcalloc()
[mirror_ubuntu-jammy-kernel.git] / drivers / hwmon / gpio-fan.c
index 5c9a52599cf68ff8d7dcb181ac3cfdc162ea3d1b..a3974cddef07908abe354f41efda61f7a391f610 100644 (file)
@@ -441,8 +441,8 @@ static int gpio_fan_get_of_data(struct gpio_fan_data *fan_data)
                dev_err(dev, "DT properties empty / missing");
                return -ENODEV;
        }
-       gpios = devm_kzalloc(dev,
-                            fan_data->num_gpios * sizeof(struct gpio_desc *),
+       gpios = devm_kcalloc(dev,
+                            fan_data->num_gpios, sizeof(struct gpio_desc *),
                             GFP_KERNEL);
        if (!gpios)
                return -ENOMEM;
@@ -471,8 +471,8 @@ static int gpio_fan_get_of_data(struct gpio_fan_data *fan_data)
         * Speed map is in the form <RPM ctrl_val RPM ctrl_val ...>
         * this needs splitting into pairs to create gpio_fan_speed structs
         */
-       speed = devm_kzalloc(dev,
-                       fan_data->num_speed * sizeof(struct gpio_fan_speed),
+       speed = devm_kcalloc(dev,
+                       fan_data->num_speed, sizeof(struct gpio_fan_speed),
                        GFP_KERNEL);
        if (!speed)
                return -ENOMEM;