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

Commit 0a3e9cc8 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa
Browse files

msm: mdss: dp: add null check for token value



Add a null check for a token value that is returned
from a string splitting function. This will prevent
null pointer dereferencing when attempting to use the
token.

CRs-Fixed: 2002785
Change-Id: I6d3c1dafc2c7d0914c116c73a8ed115c2c8f9e86
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 864ea9fc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2270,6 +2270,11 @@ static int mdss_dp_parse_config_value(char const *buf, char const *name,
	if (buf1) {
		buf1 = buf1 + strlen(name);
		token = strsep(&buf1, " ");
		if (!token) {
			pr_err("strsep failed\n");
			ret = -EINVAL;
			goto end;
		}
		ret = kstrtou32(token, 10, val);
		if (ret) {
			pr_err("kstrtoint failed. ret=%d\n", (int)ret);