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

Commit 149c346d authored by Archana Sathyakumar's avatar Archana Sathyakumar Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: rpm_stats: Fix snprintf string format



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

Change-Id: Ia85754327d342aefce2a67eb7f5aeca857d8fbcf
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 1d97a576
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2015, 2017-2018, The Linux Foundation.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -430,7 +431,7 @@ static ssize_t rpmstats_show(struct kobject *kobj,
					prvdata);
	}

	ret = snprintf(buf, prvdata->len, prvdata->buf);
	ret = snprintf(buf, prvdata->len, "%s", prvdata->buf);
	iounmap(prvdata->reg_base);
ioremap_fail:
	kfree(prvdata);