aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Li <[email protected]>2021-02-24 12:04:05 -0800
committerLinus Torvalds <[email protected]>2021-02-24 13:38:29 -0800
commit8a260162f9a0634db9a1ee7b8db276e7a00ee1d9 (patch)
tree31249ba44580e2712247f6f90f7e25d762d874eb
parent802f1d522d5fdaefc2b935141bc8fe03d43a99ab (diff)
mm/memcontrol: remove redundant NULL check
Fix below warnings reported by coccicheck: mm/memcontrol.c:451:3-9: WARNING: NULL check before some freeing functions is not needed. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Yang Li <[email protected]> Reported-by: Abaci Robot <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memcontrol.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index dce5291525a5..ed5cc78a8dbf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -452,8 +452,7 @@ static void memcg_free_shrinker_maps(struct mem_cgroup *memcg)
for_each_node(nid) {
pn = mem_cgroup_nodeinfo(memcg, nid);
map = rcu_dereference_protected(pn->shrinker_map, true);
- if (map)
- kvfree(map);
+ kvfree(map);
rcu_assign_pointer(pn->shrinker_map, NULL);
}
}