Message ID | 20231020133202.4043247-2-houtao@huaweicloud.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 394e6869f0185e89cb815db29bf819474df858ae |
Delegated to: | BPF |
Headers | show |
Series | bpf: Fixes for per-cpu kptr | expand |
diff --git a/mm/percpu.c b/mm/percpu.c index 7b40b3963f106..76b9c5e63c562 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -2267,12 +2267,10 @@ void free_percpu(void __percpu *ptr) kmemleak_free_percpu(ptr); addr = __pcpu_ptr_to_addr(ptr); - - spin_lock_irqsave(&pcpu_lock, flags); - chunk = pcpu_chunk_addr_search(addr); off = addr - chunk->base_addr; + spin_lock_irqsave(&pcpu_lock, flags); size = pcpu_free_area(chunk, off); pcpu_memcg_free_hook(chunk, off, size);