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

Commit 3d8b58e5 authored by Ping Li's avatar Ping Li
Browse files

msm: mdss: Properly free memory in error case



Free previously allocated memory in error return cases to avoid
memory leak.

CRs-Fixed: 1005989
Change-Id: I9676eb2c75e7be42b1b1901194ba5c2a206dbeb3
Signed-off-by: default avatarPing Li <pingli@codeaurora.org>
parent 22c4c57b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -649,8 +649,10 @@ static ssize_t mdss_dsi_cmd_state_write(struct file *file,
		return -ENOMEM;
	}

	if (copy_from_user(input, p, count))
	if (copy_from_user(input, p, count)) {
		kfree(input);
		return -EFAULT;
	}
	input[count-1] = '\0';

	if (strnstr(input, "dsi_hs_mode", strlen("dsi_hs_mode")))