diff options
author | Matteo Croce <teknoraver@meta.com> | 2025-07-17 22:03:37 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2025-07-18 08:29:50 -0700 |
commit | 0ee30d937c147fc14c4b49535181d437cd2fde7a (patch) | |
tree | 66b6d86273cba8ffc3bb7c614e0bc022b92ca028 /kernel/bpf/helpers.c | |
parent | 0768e980feb5cffe63920d375bebef3bb4654961 (diff) |
libbpf: Fix warning in calloc() usage
When compiling libbpf with some compilers, this warning is triggered:
libbpf.c: In function ‘bpf_object__gen_loader’:
libbpf.c:9209:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
9209 | gen = calloc(sizeof(*gen), 1);
| ^
libbpf.c:9209:28: note: earlier argument should specify number of elements, later size of each element
Fix this by inverting the calloc() arguments.
Signed-off-by: Matteo Croce <teknoraver@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20250717200337.49168-1-technoboy85@gmail.com
Diffstat (limited to 'kernel/bpf/helpers.c')
0 files changed, 0 insertions, 0 deletions