Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8edc1b3d authored by Patrick Daly's avatar Patrick Daly
Browse files

msm: acpuclock-cortex: Fix off by one error for large frequency tables



If a frequency table was greater than a certain size, data will be written
past the end of an array. Fix the loop conditions to prevent this.

CRs-fixed: 561651
Change-Id: If7bafcf79c044877f4a29c2437c139d23aa1fb32
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent ede13cb6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ static void __init cpufreq_table_init(void)

	/* Construct the freq_table tables from priv->freq_tbl. */
	for (i = 0; priv->freq_tbl[i].khz != 0
			&& freq_cnt < ARRAY_SIZE(freq_table); i++) {
			&& freq_cnt < ARRAY_SIZE(freq_table) - 1; i++) {
		if (!priv->freq_tbl[i].use_for_scaling)
			continue;
		freq_table[freq_cnt].index = freq_cnt;