ANDROID: fix ENOMEM check of binder_proc_ext
The check should be done against 'eproc' before it gets dereferenced. Fixes: d49297739550 ("BACKPORT: binder: use euid from cred instead of using task") Change-Id: Ief0c08212c4da8bdfdf628474de9dd30ee5a8db0 Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
parent
4a0304ecc3
commit
2dadc3eb35
1 changed files with 2 additions and 2 deletions
|
@ -6093,9 +6093,9 @@ static int binder_open(struct inode *nodp, struct file *filp)
|
||||||
current->group_leader->pid, current->pid);
|
current->group_leader->pid, current->pid);
|
||||||
|
|
||||||
eproc = kzalloc(sizeof(*eproc), GFP_KERNEL);
|
eproc = kzalloc(sizeof(*eproc), GFP_KERNEL);
|
||||||
proc = &eproc->proc;
|
if (eproc == NULL)
|
||||||
if (proc == NULL)
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
proc = &eproc->proc;
|
||||||
spin_lock_init(&proc->inner_lock);
|
spin_lock_init(&proc->inner_lock);
|
||||||
spin_lock_init(&proc->outer_lock);
|
spin_lock_init(&proc->outer_lock);
|
||||||
get_task_struct(current->group_leader);
|
get_task_struct(current->group_leader);
|
||||||
|
|
Loading…
Reference in a new issue