diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 3b0b88c3377d22ddfac00a488d9e9aa20999ebce..fc41c3f2e983b6bc235393ecb2d3c4a365f11122 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -1283,7 +1283,7 @@ static size_t bpf_map_mmap_sz(const struct bpf_map *map) long page_sz = sysconf(_SC_PAGE_SIZE); size_t map_sz; - map_sz = roundup(map->def.value_size, 8) * map->def.max_entries; + map_sz = (size_t)roundup(map->def.value_size, 8) * map->def.max_entries; map_sz = roundup(map_sz, page_sz); return map_sz; }