Merge "msm: mdss: information leak during buffer copy from userspace"

This commit is contained in:
Linux Build Service Account 2017-07-07 17:45:53 -07:00 committed by Gerrit - the friendly Code Review server
commit 719e5e1640

View file

@ -909,10 +909,15 @@ static ssize_t mdss_dsi_cmd_write(struct file *file, const char __user *p,
/* Writing in batches is possible */
ret = simple_write_to_buffer(string_buf, blen, ppos, p, count);
if (ret < 0) {
pr_err("%s: Failed to copy data\n", __func__);
mutex_unlock(&pcmds->dbg_mutex);
return -EINVAL;
}
string_buf[blen] = '\0';
string_buf[ret] = '\0';
pcmds->string_buf = string_buf;
pcmds->sblen = blen;
pcmds->sblen = count;
mutex_unlock(&pcmds->dbg_mutex);
return ret;
}