UPSTREAM: ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
author宋金时 <songjinshi@xiaomi.com>
Thu, 10 May 2018 02:05:03 +0000 (02:05 +0000)
committerMunjoo Kim <munjoo.kim@samsung.com>
Wed, 6 Mar 2019 04:15:50 +0000 (13:15 +0900)
When to execute binder_stat_br the e->cmd has been modifying as BR_OK
instead of the original return error cmd, in fact we want to know the
original return error, such as BR_DEAD_REPLY or BR_FAILED_REPLY, etc.
instead of always BR_OK, in order to avoid the value of the e->cmd is
always BR_OK, so we need assign the value of the e->cmd to cmd before
e->cmd = BR_OK.

Signed-off-by: songjinshi <songjinshi@xiaomi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 838d5565669aa5bb7deb605684a5970d51d5eaf6)

Change-Id: I425b32c5419a491c6b9ceee7c00dde6513e0421d

drivers/android/binder.c

index 20aaf366559b43d0c1e1119cc907408f78e1888c..e048cd7cd799095d355b797d0d450d8a0ddef29c 100644 (file)
@@ -4091,6 +4091,7 @@ retry:
                        binder_inner_proc_unlock(proc);
                        if (put_user(e->cmd, (uint32_t __user *)ptr))
                                return -EFAULT;
+                       cmd = e->cmd;
                        e->cmd = BR_OK;
                        ptr += sizeof(uint32_t);