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

Commit 031e0751 authored by Jonathan Avila's avatar Jonathan Avila
Browse files

cpufreq: schedutil: Don't use sprintf



Sprintf has security issues; replace with scnprintf where appropriate.

Change-Id: I5b4bce0d37e2ede73324dc753f298d8ac236ddd9
Signed-off-by: default avatarJonathan Avila <avilaj@codeaurora.org>
parent 17ebf063
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -635,14 +635,14 @@ static ssize_t up_rate_limit_us_show(struct gov_attr_set *attr_set, char *buf)
{
	struct sugov_tunables *tunables = to_sugov_tunables(attr_set);

	return sprintf(buf, "%u\n", tunables->up_rate_limit_us);
	return scnprintf(buf, PAGE_SIZE, "%u\n", tunables->up_rate_limit_us);
}

static ssize_t down_rate_limit_us_show(struct gov_attr_set *attr_set, char *buf)
{
	struct sugov_tunables *tunables = to_sugov_tunables(attr_set);

	return sprintf(buf, "%u\n", tunables->down_rate_limit_us);
	return scnprintf(buf, PAGE_SIZE, "%u\n", tunables->down_rate_limit_us);
}

static ssize_t up_rate_limit_us_store(struct gov_attr_set *attr_set,