Message ID | 20220810080538.1845898-3-houtao@huaweicloud.com (mailing list archive) |
---|---|
State | Accepted |
Commit | ef1e93d2eeb58a1f08c37b22a2314b94bc045f15 |
Delegated to: | BPF |
Headers | show |
Series | fixes for bpf map iterator | expand |
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index da7578426a46..da8c0177f773 100644 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -2064,6 +2064,7 @@ static int bpf_iter_init_hash_map(void *priv_data, seq_info->percpu_value_buf = value_buf; } + bpf_map_inc_with_uref(map); seq_info->map = map; seq_info->htab = container_of(map, struct bpf_htab, map); return 0; @@ -2073,6 +2074,7 @@ static void bpf_iter_fini_hash_map(void *priv_data) { struct bpf_iter_seq_hash_map_info *seq_info = priv_data; + bpf_map_put_with_uref(seq_info->map); kfree(seq_info->percpu_value_buf); }