diff --git a/drivers/video/msm/mdss/mdss_dsi.c b/drivers/video/msm/mdss/mdss_dsi.c index 7b2677e80117..3f29f23114f3 100644 --- a/drivers/video/msm/mdss/mdss_dsi.c +++ b/drivers/video/msm/mdss/mdss_dsi.c @@ -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")))