mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 14:14:24 +08:00
bpf: Fix order of args in call to bpf_map_kvcalloc
The original function call passed size of smap->bucket before the number of buckets which raises the error 'calloc-transposed-args' on compilation. Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240516072411.42016-1-sheharyaar48@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
34021caef7
commit
6f130e4d4a
@ -782,8 +782,8 @@ bpf_local_storage_map_alloc(union bpf_attr *attr,
|
||||
nbuckets = max_t(u32, 2, nbuckets);
|
||||
smap->bucket_log = ilog2(nbuckets);
|
||||
|
||||
smap->buckets = bpf_map_kvcalloc(&smap->map, sizeof(*smap->buckets),
|
||||
nbuckets, GFP_USER | __GFP_NOWARN);
|
||||
smap->buckets = bpf_map_kvcalloc(&smap->map, nbuckets,
|
||||
sizeof(*smap->buckets), GFP_USER | __GFP_NOWARN);
|
||||
if (!smap->buckets) {
|
||||
err = -ENOMEM;
|
||||
goto free_smap;
|
||||
|
Loading…
Reference in New Issue
Block a user