summaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-10-11 10:20:53 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-10-11 22:28:47 +0200
commit2dedd7d2165565bafa89718eaadfc5d1a7865f66 (patch)
tree1c5368d7853a42e07888a19c30e7747f4cd541e7 /kernel/bpf
parentf97eea1756f383fefc147f4c76c54942944a3d95 (diff)
downloadlinux-2dedd7d2165565bafa89718eaadfc5d1a7865f66.tar.bz2
bpf: Fix cast to pointer from integer of different size warning
Fix "warning: cast to pointer from integer of different size" when casting u64 addr to void *. Fixes: a23740ec43ba ("bpf: Track contents of read-only maps as scalars") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20191011172053.2980619-1-andriin@fb.com
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/verifier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index b818fed3208d..d3446f018b9a 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2753,7 +2753,7 @@ static int bpf_map_direct_read(struct bpf_map *map, int off, int size, u64 *val)
err = map->ops->map_direct_value_addr(map, &addr, off);
if (err)
return err;
- ptr = (void *)addr + off;
+ ptr = (void *)(long)addr + off;
switch (size) {
case sizeof(u8):