Skip to content

Commit 9a0a930

Browse files
arndbgregkh
authored andcommitted
binder: fix pointer cast warning
binder_uintptr_t is not the same as uintptr_t, so converting it into a pointer requires a second cast: drivers/android/binder.c: In function 'binder_translate_fd_array': drivers/android/binder.c:2511:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 2511 | sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset; | ^ Fixes: 656e01f ("binder: read pre-translated fds from sender buffer") Acked-by: Todd Kjos <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Acked-by: Christian Brauner <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2925fc1 commit 9a0a930

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/android/binder.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,8 @@ static int binder_translate_fd_array(struct list_head *pf_head,
25082508
*/
25092509
fda_offset = (parent->buffer - (uintptr_t)t->buffer->user_data) +
25102510
fda->parent_offset;
2511-
sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset;
2511+
sender_ufda_base = (void __user *)(uintptr_t)sender_uparent->buffer +
2512+
fda->parent_offset;
25122513

25132514
if (!IS_ALIGNED((unsigned long)fda_offset, sizeof(u32)) ||
25142515
!IS_ALIGNED((unsigned long)sender_ufda_base, sizeof(u32))) {

0 commit comments

Comments
 (0)