Merge "msm: mdss: validate the buffer size before allocating memory"
This commit is contained in:
commit
cfdc77c29d
1 changed files with 5 additions and 0 deletions
|
@ -773,6 +773,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…
Add table
Reference in a new issue