|
@@ -993,7 +993,8 @@ static int clk_rcg2_dfs_populate_freq_table(struct clk_rcg2 *rcg)
|
|
|
struct freq_tbl *freq_tbl;
|
|
|
int i;
|
|
|
|
|
|
- freq_tbl = kcalloc(MAX_PERF_LEVEL, sizeof(*freq_tbl), GFP_KERNEL);
|
|
|
+ /* Allocate space for 1 extra since table is NULL terminated */
|
|
|
+ freq_tbl = kcalloc(MAX_PERF_LEVEL + 1, sizeof(*freq_tbl), GFP_KERNEL);
|
|
|
if (!freq_tbl)
|
|
|
return -ENOMEM;
|
|
|
rcg->freq_tbl = freq_tbl;
|