mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
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: Ping Li <pingli@codeaurora.org>
This commit is contained in:
parent
09997661e4
commit
7884938777
1 changed files with 3 additions and 1 deletions
|
@ -668,8 +668,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")))
|
||||
|
|
Loading…
Reference in a new issue