diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-08-02 21:58:52 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-02 21:58:52 -0700 |
| commit | 8d5e73afc5933defbd78b5f011bc2ed6fb0e0161 (patch) | |
| tree | 7a2cf3236b2e20e6589cbbb26319c7cf497f0f59 | |
| parent | 934a7620a1b981a9354839296bbf8ddc972f0781 (diff) | |
| parent | 821e02f204974b2358dfc950d8de5bd19af7fbf2 (diff) | |
Merge "CHROMIUM: android: binder: Fix potential scheduling-while-atomic"
| -rw-r--r-- | drivers/android/binder.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 61df1ea0659d..20d17906fc9b 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -379,6 +379,7 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) struct files_struct *files = proc->files; unsigned long rlim_cur; unsigned long irqs; + int ret; if (files == NULL) return -ESRCH; @@ -389,7 +390,11 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE); unlock_task_sighand(proc->tsk, &irqs); - return __alloc_fd(files, 0, rlim_cur, flags); + preempt_enable_no_resched(); + ret = __alloc_fd(files, 0, rlim_cur, flags); + preempt_disable(); + + return ret; } /* @@ -398,8 +403,11 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) static void task_fd_install( struct binder_proc *proc, unsigned int fd, struct file *file) { - if (proc->files) + if (proc->files) { + preempt_enable_no_resched(); __fd_install(proc->files, fd, file); + preempt_disable(); + } } /* |
