From 592fd56d4984e12567a6232ad6dbb66675303684 Mon Sep 17 00:00:00 2001 From: Rohit Jnagal Date: Tue, 29 Apr 2014 18:59:20 +0000 Subject: [PATCH] Cleanup existing controllers when cleanup fails mid-way. Docker-DCO-1.1-Signed-off-by: Rohit Jnagal (github: rjnagal) --- cgroups/fs/apply_raw.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cgroups/fs/apply_raw.go b/cgroups/fs/apply_raw.go index 60f318e..5f9fc82 100644 --- a/cgroups/fs/apply_raw.go +++ b/cgroups/fs/apply_raw.go @@ -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 } }