treewide: kzalloc() -> kcalloc()
[linux-2.6-microblaze.git] / drivers / hwmon / i5k_amb.c
index 9397d2f..a4edc43 100644 (file)
@@ -274,8 +274,9 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                num_ambs += hweight16(data->amb_present[i] & 0x7fff);
 
        /* Set up sysfs stuff */
-       data->attrs = kzalloc(sizeof(*data->attrs) * num_ambs * KNOBS_PER_AMB,
-                               GFP_KERNEL);
+       data->attrs = kzalloc(array3_size(num_ambs, KNOBS_PER_AMB,
+                                         sizeof(*data->attrs)),
+                             GFP_KERNEL);
        if (!data->attrs)
                return -ENOMEM;
        data->num_attrs = 0;