diff options
author | Tony Lindgren <tony@atomide.com> | 2021-02-15 06:41:56 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2021-02-15 06:41:56 +0200 |
commit | 857de6fe2f86b009df620f7cdb07c262cc17070d (patch) | |
tree | e9718ebeeef39485a51a9f8e3c8122da18c796cf /kernel/bpf/stackmap.c | |
parent | 9bbce32a20d6a72c767a7f85fd6127babd1410ac (diff) | |
parent | fbfa463be8dc7957ee4f81556e9e1ea2a951807d (diff) |
Merge branch 'fixes-v5.11' into fixes
Diffstat (limited to 'kernel/bpf/stackmap.c')
-rw-r--r-- | kernel/bpf/stackmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index aea96b638473..bfafbf115bf3 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -115,6 +115,8 @@ static struct bpf_map *stack_map_alloc(union bpf_attr *attr) /* hash table size must be power of 2 */ n_buckets = roundup_pow_of_two(attr->max_entries); + if (!n_buckets) + return ERR_PTR(-E2BIG); cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); cost += n_buckets * (value_size + sizeof(struct stack_map_bucket)); |