summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Ballesio <balejs@google.com>2021-03-09 16:35:45 -0800
committerGeorg Veichtlbauer <georg@vware.at>2023-07-16 12:47:43 +0200
commitd5cd35f38616a70453da067eda153f5dc5ede3a1 (patch)
treef686355e49facd6952437e62b933396cdcc6ea84
parentdb74739c86de566ca88a8affa96d2d59cfbdbb98 (diff)
FROMGIT: binder: use EINTR for interrupted wait for work
when interrupted by a signal, binder_wait_for_work currently returns -ERESTARTSYS. This error code isn't propagated to user space, but a way to handle interruption due to signals must be provided to code using this API. Replace this instance of -ERESTARTSYS with -EINTR, which is propagated to user space. Bug: 180989544 (cherry picked from commit 48f10b7ed0c23e2df7b2c752ad1d3559dad007f9 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing) Signed-off-by: Marco Ballesio <balejs@google.com> Signed-off-by: Li Li <dualli@google.com> Test: built, booted, interrupted a worker thread within Acked-by: Todd Kjos <tkjos@google.com> Link: https://lore.kernel.org/r/20210316011630.1121213-3-dualli@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: Ie6c7993cab699bc2c1a25a2f9d94b200a1156e5d
-rw-r--r--drivers/android/binder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 7c584e2ea476..370f1452710f 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4062,7 +4062,7 @@ static int binder_wait_for_work(struct binder_thread *thread,
binder_inner_proc_lock(proc);
list_del_init(&thread->waiting_thread_node);
if (signal_pending(current)) {
- ret = -ERESTARTSYS;
+ ret = -EINTR;
break;
}
}
@@ -4991,7 +4991,7 @@ err:
if (thread)
thread->looper_need_return = false;
wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
- if (ret && ret != -ERESTARTSYS)
+ if (ret && ret != -EINTR)
pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret);
err_unlocked:
trace_binder_ioctl_done(ret);