Merge "msm: mdss: validate the buffer size before allocating memory"
This commit is contained in:
commit
bf1349b227
|
@ -663,6 +663,11 @@ static ssize_t mdss_dsi_cmd_state_write(struct file *file,
|
|||
int *link_state = file->private_data;
|
||||
char *input;
|
||||
|
||||
if (!count) {
|
||||
pr_err("%s: Zero bytes to be written\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
input = kmalloc(count, GFP_KERNEL);
|
||||
if (!input) {
|
||||
pr_err("%s: Failed to allocate memory\n", __func__);
|
||||
|
|
Loading…
Reference in New Issue