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

Commit a5774c4e authored by Amir Levy's avatar Amir Levy
Browse files

msm: ipa4: Ignore newline ending character on ipa write input



ipa_write character device function is called from user space
to pass configuration during boot. Ignore ending \n character
at the given string.

Change-Id: I33ee23ddfcc40b9693da7542bbb7b1cebff975f4
CRs-fixed: 2156924
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent 21a1b0f4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -4650,7 +4650,6 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf,
		return -EFAULT;
	}

	if (count > 0)
	dbg_buff[count] = '\0';

	IPADBG("user input string %s\n", dbg_buff);
@@ -4680,11 +4679,15 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf,
			return count;
		}

		/* trim ending newline character if any */
		if (count && (dbg_buff[count - 1] == '\n'))
			dbg_buff[count - 1] = '\0';

		if (!strcasecmp(dbg_buff, "MHI")) {
			ipa3_ctx->ipa_config_is_mhi = true;
			pr_info(
				"IPA is loading with MHI configuration\n");
		} else if (!strcmp(dbg_buff, "1\n")) {
		} else if (!strcmp(dbg_buff, "1")) {
			pr_info(
				"IPA is loading with non MHI configuration\n");
		} else {