Skip to content

Commit 66b83a4

Browse files
Martijn Coenengregkh
authored andcommitted
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. Signed-off-by: Martijn Coenen <maco@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 33d930e commit 66b83a4

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/android/binder.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,12 +3662,6 @@ static void binder_stat_br(struct binder_proc *proc,
36623662
}
36633663
}
36643664

3665-
static int binder_has_thread_work(struct binder_thread *thread)
3666-
{
3667-
return !binder_worklist_empty(thread->proc, &thread->todo) ||
3668-
thread->looper_need_return;
3669-
}
3670-
36713665
static int binder_put_node_cmd(struct binder_proc *proc,
36723666
struct binder_thread *thread,
36733667
void __user **ptrp,
@@ -4297,12 +4291,9 @@ static unsigned int binder_poll(struct file *filp,
42974291

42984292
binder_inner_proc_unlock(thread->proc);
42994293

4300-
if (binder_has_work(thread, wait_for_proc_work))
4301-
return POLLIN;
4302-
43034294
poll_wait(filp, &thread->wait, wait);
43044295

4305-
if (binder_has_thread_work(thread))
4296+
if (binder_has_work(thread, wait_for_proc_work))
43064297
return POLLIN;
43074298

43084299
return 0;

0 commit comments

Comments
 (0)