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

Commit 15c1c09d authored by Shreyas K K's avatar Shreyas K K
Browse files

soc: qcom: Increase bootmarker read buffer



There are more users to bootmarker now. Increase bootmarker
read buffer to accommodate for all. Add checks to catch buffer
overflow.

Change-Id: Icc7db4c041d72008b5090685da0db0da7a155efb
Signed-off-by: default avatarShreyas K K <shrekk@codeaurora.org>
parent 821a4366
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#define MAX_STRING_LEN 256
#define BOOT_MARKER_MAX_LEN 50
#define MSM_ARCH_TIMER_FREQ     19200000
#define BOOTKPI_BUF_SIZE (2 * PAGE_SIZE)

struct boot_marker {
	char marker_name[BOOT_MARKER_MAX_LEN];
@@ -175,13 +176,14 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer,
	int temp = 0;
	struct boot_marker *marker;

	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
	buf = kmalloc(BOOTKPI_BUF_SIZE, GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

	spin_lock(&boot_marker_list.slock);
	list_for_each_entry(marker, &boot_marker_list.list, list) {
		temp += scnprintf(buf + temp, PAGE_SIZE - temp,
		WARN_ON((BOOTKPI_BUF_SIZE - temp) <= 0);
		temp += scnprintf(buf + temp, BOOTKPI_BUF_SIZE - temp,
				"%-41s:%llu.%03llu seconds\n",
				marker->marker_name,
				marker->timer_value/TIMER_KHZ,