treewide: devm_kzalloc() -> devm_kcalloc()
[sfrench/cifs-2.6.git] / drivers / devfreq / devfreq.c
index fe2af6aa88fc2b0cec9a103fcc2ca682f073659a..0b5b3abe054e6427f779beca3098a8d37d15cee3 100644 (file)
@@ -628,14 +628,15 @@ struct devfreq *devfreq_add_device(struct device *dev,
                goto err_dev;
        }
 
-       devfreq->trans_table =  devm_kzalloc(&devfreq->dev,
-                                               sizeof(unsigned int) *
-                                               devfreq->profile->max_state *
-                                               devfreq->profile->max_state,
-                                               GFP_KERNEL);
-       devfreq->time_in_state = devm_kzalloc(&devfreq->dev,
-                                               sizeof(unsigned long) *
+       devfreq->trans_table =
+               devm_kzalloc(&devfreq->dev,
+                            array3_size(sizeof(unsigned int),
+                                        devfreq->profile->max_state,
+                                        devfreq->profile->max_state),
+                            GFP_KERNEL);
+       devfreq->time_in_state = devm_kcalloc(&devfreq->dev,
                                                devfreq->profile->max_state,
+                                               sizeof(unsigned long),
                                                GFP_KERNEL);
        devfreq->last_stat_updated = jiffies;