Skip to content

Commit

Permalink
mm/memcontrol: remove redundant NULL check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Yang Li authored and torvalds committed Feb 24, 2021
1 parent 802f1d5 commit 8a26016
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 8a26016

Please sign in to comment.