diff options
author | Martijn Coenen <maco@android.com> | 2017-08-10 12:32:00 +0200 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2017-08-23 18:53:58 +0530 |
commit | 4113f34dd7dd3a454a21fb8fd11186f5d4c764ac (patch) | |
tree | f2854b7c8182b0906501c049b82ab4d28bc5f2ca | |
parent | 5a5dafe42a1b52576aa811fb184863e3fa78059c (diff) | |
download | linaro-android-4113f34dd7dd3a454a21fb8fd11186f5d4c764ac.tar.gz |
ANDROID: binder: call poll_wait() unconditionally.
Because we're not guaranteed that subsequent calls
to poll() will have a poll_table_struct parameter
with _qproc set. When _qproc is not set, poll_wait()
is a noop, and we won't be woken up correctly.
Bug: 64552728
Change-Id: I5b904c9886b6b0994d1631a636f5c5e5f6327950
Test: binderLibTest stops hanging with new test
Signed-off-by: Martijn Coenen <maco@android.com>
-rw-r--r-- | drivers/android/binder.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index f2169494f1aa..16af5860d432 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3791,12 +3791,6 @@ static void binder_stat_br(struct binder_proc *proc, } } -static int binder_has_thread_work(struct binder_thread *thread) -{ - return !binder_worklist_empty(thread->proc, &thread->todo) || - thread->looper_need_return; -} - static int binder_put_node_cmd(struct binder_proc *proc, struct binder_thread *thread, void __user **ptrp, @@ -4427,12 +4421,9 @@ static unsigned int binder_poll(struct file *filp, binder_inner_proc_unlock(thread->proc); - if (binder_has_work(thread, wait_for_proc_work)) - return POLLIN; - poll_wait(filp, &thread->wait, wait); - if (binder_has_thread_work(thread)) + if (binder_has_work(thread, wait_for_proc_work)) return POLLIN; return 0; |