Merge tag 'for-linus-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / kernel / bpf / bpf_lru_list.c
index 1b6b934..d99e89f 100644 (file)
@@ -502,13 +502,14 @@ struct bpf_lru_node *bpf_lru_pop_free(struct bpf_lru *lru, u32 hash)
 static void bpf_common_lru_push_free(struct bpf_lru *lru,
                                     struct bpf_lru_node *node)
 {
+       u8 node_type = READ_ONCE(node->type);
        unsigned long flags;
 
-       if (WARN_ON_ONCE(node->type == BPF_LRU_LIST_T_FREE) ||
-           WARN_ON_ONCE(node->type == BPF_LRU_LOCAL_LIST_T_FREE))
+       if (WARN_ON_ONCE(node_type == BPF_LRU_LIST_T_FREE) ||
+           WARN_ON_ONCE(node_type == BPF_LRU_LOCAL_LIST_T_FREE))
                return;
 
-       if (node->type == BPF_LRU_LOCAL_LIST_T_PENDING) {
+       if (node_type == BPF_LRU_LOCAL_LIST_T_PENDING) {
                struct bpf_lru_locallist *loc_l;
 
                loc_l = per_cpu_ptr(lru->common_lru.local_list, node->cpu);