Cleanup existing controllers when cleanup fails mid-way.

Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
Upstream-commit: 070747a21365959d3179d8df627d3e614318e202
Component: engine
This commit is contained in:
Rohit Jnagal
2014-04-29 18:59:20 +00:00
parent 7fb7f768a7
commit 3267a2a3bd
@@ -67,6 +67,7 @@ func Apply(c *cgroups.Cgroup, pid int) (cgroups.ActiveCgroup, error) {
}
for _, sys := range subsystems {
if err := sys.Set(d); err != nil {
d.Cleanup()
return nil, err
}
}