Skip to content

Commit

Permalink
cpufreq / intel_pstate: use vzalloc() instead of vmalloc()/memset(0)
Browse files Browse the repository at this point in the history
Use vzalloc() instead of vmalloc() and memset(0).

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Wei Yongjun authored and Rafael J. Wysocki committed May 13, 2013
1 parent 60e6726 commit b57ffac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,9 @@ static int __init intel_pstate_init(void)

pr_info("Intel P-state driver initializing.\n");

all_cpu_data = vmalloc(sizeof(void *) * num_possible_cpus());
all_cpu_data = vzalloc(sizeof(void *) * num_possible_cpus());
if (!all_cpu_data)
return -ENOMEM;
memset(all_cpu_data, 0, sizeof(void *) * num_possible_cpus());

rc = cpufreq_register_driver(&intel_pstate_driver);
if (rc)
Expand Down

0 comments on commit b57ffac

Please sign in to comment.