Duplicate errors can be returned to userspace when the thread
error code is left set when the read buffer runs out of space.

Signed-off-by: Riley Andrews <riandr...@android.com>
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index f1a26d9..2069759 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2167,9 +2167,9 @@ retry:
                                return -EFAULT;
                        ptr += sizeof(uint32_t);
                        binder_stat_br(proc, thread, thread->return_error2);
+                       thread->return_error2 = BR_OK;
                        if (ptr == end)
                                goto done;
-                       thread->return_error2 = BR_OK;
                }
                if (put_user(thread->return_error, (uint32_t __user *)ptr))
                        return -EFAULT;
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to