diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index 88fc30d2f5fd9b59379389fbddc194dd7ad26f9e..e604a6f80194a5fb52a0446ace4b1b6942dee73b 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;