summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorPing Li <pingli@codeaurora.org>2016-04-20 17:09:36 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-11 17:43:53 -0700
commit21324680d92f010a02c38ed29343cf4bd4eb1aaa (patch)
treedc60f078b723fe8b488e11c3bd1564b6d4ef8032 /drivers/video/fbdev
parentaa9bc41df39a1a71a38d39525a4a2663f10d2508 (diff)
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>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index de65567f2844..de4c4c7c2762 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -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")))