forked from rubenslte/android_kernel_samsung_msm8226
ANDROID: binder: fix compilation warnings.
When using the 64-bit binder interface on 32-bit kernels. These are safe to cast, because they are buffers we have previously successfully called copy_from_user() on. Change-Id: Ifa4ef2f99b28202d3d1bd1417e441266a2609cec Signed-off-by: Martijn Coenen <maco@android.com> Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
dbf7f57dea
commit
b12bf18423
@@ -1677,7 +1677,8 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
|
||||
debug_id, (u64)fda->num_fds);
|
||||
continue;
|
||||
}
|
||||
fd_array = (u32 *)(parent_buffer + fda->parent_offset);
|
||||
fd_array = (u32 *)(uintptr_t)
|
||||
(parent_buffer + fda->parent_offset);
|
||||
for (fd_index = 0; fd_index < fda->num_fds; fd_index++)
|
||||
task_close_fd(proc, fd_array[fd_index]);
|
||||
} break;
|
||||
@@ -1882,7 +1883,7 @@ static int binder_translate_fd_array(struct binder_fd_array_object *fda,
|
||||
* back to the kernel address space to access it
|
||||
*/
|
||||
parent_buffer = parent->buffer - target_proc->user_buffer_offset;
|
||||
fd_array = (u32 *)(parent_buffer + fda->parent_offset);
|
||||
fd_array = (u32 *)(uintptr_t)(parent_buffer + fda->parent_offset);
|
||||
if (!IS_ALIGNED((unsigned long)fd_array, sizeof(u32))) {
|
||||
binder_user_error("%d:%d parent offset not aligned correctly.\n",
|
||||
proc->pid, thread->pid);
|
||||
@@ -1948,7 +1949,7 @@ static int binder_fixup_parent(struct binder_transaction *t,
|
||||
proc->pid, thread->pid);
|
||||
return -EINVAL;
|
||||
}
|
||||
parent_buffer = (u8 *)(parent->buffer -
|
||||
parent_buffer = (u8 *)(uintptr_t)(parent->buffer -
|
||||
target_proc->user_buffer_offset);
|
||||
*(binder_uintptr_t *)(parent_buffer + bp->parent_offset) = bp->buffer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user