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

Commit 46db0dcd authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

cpuidle: lpm-levels: Fix snprintf string format



Undefined string lengths could lead to buffer overflows. Format the
string correctly to ensure proper usage of snprintf.

Change-Id: I996f41197606f4b9877cf0fbc6c57145480b5c1c
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1464,7 +1464,8 @@ static int cluster_cpuidle_register(struct lpm_cluster *cl)
			struct lpm_cpu_level *cpu_level = &lpm_cpu->levels[i];

			snprintf(st->name, CPUIDLE_NAME_LEN, "C%u\n", i);
			snprintf(st->desc, CPUIDLE_DESC_LEN, cpu_level->name);
			snprintf(st->desc, CPUIDLE_DESC_LEN, "%s",
					cpu_level->name);
			st->flags = 0;
			st->exit_latency = cpu_level->pwr.latency_us;
			st->power_usage = cpu_level->pwr.ss_power;