提交 2dedd7d2 编写于 作者: A Andrii Nakryiko 提交者: Daniel Borkmann

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: a23740ec ("bpf: Track contents of read-only maps as scalars")
Reported-by: Nkbuild test robot <lkp@intel.com>
Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191011172053.2980619-1-andriin@fb.com
上级 f97eea17
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册