bpf: fix cast to pointer from integer of different size warning
Subsystems (4)
PATCH 1/1 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 *.
Reported-by kbuild test robot <[email protected]>
Signed-off-by Andrii Nakryiko <[email protected]>
--- kernel/bpf/verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +1 -1
@@ -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):
Signature · 1 line
2.17.1
Quoted 5 lines · Andrii Nakryiko
Fix "warning: cast to pointer from integer of different size" when casting u64 addr to void *.
Reported-by kbuild test robot <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>
Fixes a23740ec43ba ("bpf: Track contents of read-only maps as scalars")
Acked-by Martin KaFai Lau <[email protected]>
Quoted 8 lines · Martin Lau
Quoted 5 lines · Andrii Nakryiko
Fix "warning: cast to pointer from integer of different size" when casting u64 addr to void *.
Reported-by kbuild test robot <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>Fixes a23740ec43ba ("bpf: Track contents of read-only maps as scalars")
Oh, right, thanks! I'll post v2 w/ Ack and Fixes tags.
Quoted 2 lines
Acked-by Martin KaFai Lau <[email protected]>