mirror of
https://github.com/torvalds/linux.git
synced 2026-12-01 11:03:37 +00:00
memcg: avoid dangling reference count in creation failure.
When use_hierarchy is enabled, we acquire an extra reference count in our parent during cgroup creation. We don't release it, though, if any failure exist in the creation process. Signed-off-by: Glauber Costa <[email protected]> Reported-by: Michal Hocko <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Hiroyuki Kamezawa <[email protected]> Cc: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
committed by
Linus Torvalds
parent
692e89abd1
commit
e4715f01be
@@ -6196,6 +6196,8 @@ mem_cgroup_css_online(struct cgroup *cont)
|
||||
* call __mem_cgroup_free, so return directly
|
||||
*/
|
||||
mem_cgroup_put(memcg);
|
||||
if (parent->use_hierarchy)
|
||||
mem_cgroup_put(parent);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user