diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-12-07 13:24:42 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-08 17:30:03 +0100 |
commit | 9a0a930fe2535a76ad70d3f43caeccf0d86a3009 (patch) | |
tree | 3ecc835713ad0a98d7d49857f4929a5b3fa20207 /drivers/android | |
parent | 2925fc1c102943a2496e13ef78d68acd5fd0dc99 (diff) | |
download | linux-stable-9a0a930fe2535a76ad70d3f43caeccf0d86a3009.tar.gz linux-stable-9a0a930fe2535a76ad70d3f43caeccf0d86a3009.tar.bz2 linux-stable-9a0a930fe2535a76ad70d3f43caeccf0d86a3009.zip |
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: 656e01f3ab54 ("binder: read pre-translated fds from sender buffer")
Acked-by: Todd Kjos <tkjos@google.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211207122448.1185769-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
-rw-r--r-- | drivers/android/binder.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 5497797ab258..182bb4221b06 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2508,7 +2508,8 @@ static int binder_translate_fd_array(struct list_head *pf_head, */ fda_offset = (parent->buffer - (uintptr_t)t->buffer->user_data) + fda->parent_offset; - sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset; + sender_ufda_base = (void __user *)(uintptr_t)sender_uparent->buffer + + fda->parent_offset; if (!IS_ALIGNED((unsigned long)fda_offset, sizeof(u32)) || !IS_ALIGNED((unsigned long)sender_ufda_base, sizeof(u32))) { |