summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Coenen <maco@android.com>2017-08-10 12:32:00 +0200
committerMartijn Coenen <maco@android.com>2017-08-11 10:19:00 +0200
commit4d666b500c2de3edc65e2ab5d5fe36780c230604 (patch)
treea7e1fabce154f327c14374ac310f675a2df8ab44
parentb1c79e32b7a8b42487f4f4fe970e5bc7d5dd48a9 (diff)
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.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 4cf8e05c7a03..ea718f2995d5 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3802,12 +3802,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,
@@ -4438,12 +4432,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;