aboutsummaryrefslogtreecommitdiff
path: root/kernel/bpf/hashtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/hashtab.c')
-rw-r--r--kernel/bpf/hashtab.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 36aa16dc43ad..0d888a90a805 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -953,8 +953,12 @@ static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
__pcpu_freelist_push(&htab->freelist, &l->fnode);
} else {
dec_elem_count(htab);
- l->htab = htab;
- call_rcu(&l->rcu, htab_elem_free_rcu);
+ if (htab->map.map_type == BPF_MAP_TYPE_PERCPU_HASH) {
+ l->htab = htab;
+ call_rcu(&l->rcu, htab_elem_free_rcu);
+ } else {
+ htab_elem_free(htab, l);
+ }
}
}