diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index e47f873bc1ba..3ec76cb5f240 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -122,8 +122,6 @@ static struct bpf_map *stack_map_alloc(union bpf_attr *attr) return ERR_PTR(-E2BIG); 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); err = bpf_map_charge_init(&mem, cost + attr->max_entries *