From: Eric Biggers Date: Mon, 26 Feb 2018 18:56:45 +0000 (-0800) Subject: binder: add missing binder_unlock() X-Git-Tag: v4.4.119~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5a6a7256834ad88104d3a99cc935c9ac49b527;p=thirdparty%2Fkernel%2Fstable.git binder: add missing binder_unlock() When commit 4be5a2810489 ("binder: check for binder_thread allocation failure in binder_poll()") was applied to 4.4-stable and 4.9-stable it was forgotten to release the global binder lock in the new error path. The global binder lock wasn't removed until v4.14, by commit a60b890f607d ("binder: remove global binder lock"). Fix the new error path to release the lock. Reported-by: Guenter Roeck Signed-off-by: Eric Biggers Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 55613f6f7c0ea..260ce0e60187f 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2622,8 +2622,10 @@ static unsigned int binder_poll(struct file *filp, binder_lock(__func__); thread = binder_get_thread(proc); - if (!thread) + if (!thread) { + binder_unlock(__func__); return POLLERR; + } wait_for_proc_work = thread->transaction_stack == NULL && list_empty(&thread->todo) && thread->return_error == BR_OK;