diff options
author | Chen Ni <nichen@iscas.ac.cn> | 2025-04-17 16:43:30 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-05-11 17:48:34 -0700 |
commit | 6e14fd33f148cf36db9bcee7561f2b5b6c3b65aa (patch) | |
tree | a6ec7709166b2191943571b3a8f09e89d047c059 | |
parent | d0966120486833cd837feea9917b7ed06e74f58c (diff) |
mm: memcontrol: remove unnecessary NULL check before free_percpu()
free_percpu() checks for NULL pointers internally. Remove unneeded NULL
check here.
Link: https://lkml.kernel.org/r/20250417084330.937380-1-nichen@iscas.ac.cn
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/memcontrol-v1.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 4a9cf27a70af..54c49cbfc968 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -2198,8 +2198,7 @@ bool memcg1_alloc_events(struct mem_cgroup *memcg) void memcg1_free_events(struct mem_cgroup *memcg) { - if (memcg->events_percpu) - free_percpu(memcg->events_percpu); + free_percpu(memcg->events_percpu); } static int __init memcg1_init(void) |