From: Anand Moon Date: Fri, 5 Sep 2014 03:08:30 +0000 (+0530) Subject: cpufreq / OPP: Fix the order of arguments for kcalloc() X-Git-Tag: v3.17-rc5~27^2~1^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d359992070901bcd774615910d36cec67dbdb1a7;p=karo-tx-linux.git cpufreq / OPP: Fix the order of arguments for kcalloc() These changes fix the argument to the kcalloc @n: number of elements. @size: element size. @flags: the type of memory to allocate (see kmalloc). void *kcalloc(size_t n, size_t size, gfp_t flags) Fixes: 3c5445ce3a0c (cpufreq: OPP: Avoid sleeping while atomic) Signed-off-by: Anand Moon Acked-by: Viresh Kumar Reviewed-by: Stephen Boyd Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq_opp.c b/drivers/cpufreq/cpufreq_opp.c index f7a32d2326c6..773bcde893c0 100644 --- a/drivers/cpufreq/cpufreq_opp.c +++ b/drivers/cpufreq/cpufreq_opp.c @@ -60,7 +60,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, goto out; } - freq_table = kcalloc(sizeof(*freq_table), (max_opps + 1), GFP_ATOMIC); + freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC); if (!freq_table) { ret = -ENOMEM; goto out;