summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/cpu/clock-cpg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
index 88fc30d2f5fd..e604a6f80194 100644
--- a/arch/sh/kernel/cpu/clock-cpg.c
+++ b/arch/sh/kernel/cpu/clock-cpg.c
@@ -71,8 +71,9 @@ int __init sh_clk_div4_register(struct clk *clks, int nr,
int ret = 0;
int k;
- k = nr_divs + 1;
- freq_table = alloc_bootmem(freq_table_size * nr * (nr_divs + 1));
+ freq_table_size *= (nr_divs + 1);
+
+ freq_table = alloc_bootmem(freq_table_size * nr);
if (!freq_table)
return -ENOMEM;