mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
thermal: cpu_cooling: Replace kmalloc with kmalloc_array
Checkpatch reports following: WARNING: Prefer kmalloc_array over kmalloc with multiply + cpufreq_cdev->freq_table = kmalloc(sizeof(*cpufreq_cdev->freq_table) * i, Fix that. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
This commit is contained in:
parent
d72b401583
commit
f19b1a1735
1 changed files with 3 additions and 2 deletions
|
|
@ -724,8 +724,9 @@ __cpufreq_cooling_register(struct device_node *np,
|
|||
/* max_level is an index, not a counter */
|
||||
cpufreq_cdev->max_level = i - 1;
|
||||
|
||||
cpufreq_cdev->freq_table = kmalloc(sizeof(*cpufreq_cdev->freq_table) * i,
|
||||
GFP_KERNEL);
|
||||
cpufreq_cdev->freq_table = kmalloc_array(i,
|
||||
sizeof(*cpufreq_cdev->freq_table),
|
||||
GFP_KERNEL);
|
||||
if (!cpufreq_cdev->freq_table) {
|
||||
cdev = ERR_PTR(-ENOMEM);
|
||||
goto free_idle_time;
|
||||
|
|
|
|||
Loading…
Reference in a new issue