From fc9868e2247d2eb651586bd4b3e9a4ece3562fa0 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Sun, 13 Jun 2021 20:32:43 +0800 Subject: Fix panic condition in cgroups.getAvailableControllers Signed-off-by: zhangguanzhang --- pkg/cgroups/cgroups.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index 911edeb5b..9cb32a364 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -165,14 +165,13 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool) if _, found := exclude[name]; found { continue } - isSymLink := false fileInfo, err := os.Stat(cgroupRoot + "/" + name) if err != nil { - isSymLink = !fileInfo.IsDir() + continue } c := controller{ name: name, - symlink: isSymLink, + symlink: !fileInfo.IsDir(), } controllers = append(controllers, c) } -- cgit v1.2.3-54-g00ecf