OSDN Git Service

staging: binder: correct ptr handling
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 1 Dec 2014 17:03:18 +0000 (01:03 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 28 Dec 2014 08:03:17 +0000 (16:03 +0800)
The bug occurs if CONFIG_ANDROID_BINDER_IPC_32BIT
is not defined in 32-bit kernel.

drivers/staging/android/binder.c

index c69c40d..d53ab57 100644 (file)
@@ -2047,7 +2047,7 @@ static int binder_thread_write(struct binder_proc *proc,
                        if (get_user(cookie, (binder_uintptr_t __user *)ptr))
                                return -EFAULT;
 
-                       ptr += sizeof(void *);
+                       ptr += sizeof(binder_uintptr_t);
                        list_for_each_entry(w, &proc->delivered_death, entry) {
                                struct binder_ref_death *tmp_death = container_of(w, struct binder_ref_death, work);