summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-15 09:29:33 -0400
committerGitHub <noreply@github.com>2021-06-15 09:29:33 -0400
commit6b517a7e9077330bfe81d84401aa856e2fab380c (patch)
tree4fa3a4731493e02201d356f2b77121834a7d8586
parente2f51eeb0693eda026fa509a9decfbdd7e0b74a8 (diff)
parentfc9868e2247d2eb651586bd4b3e9a4ece3562fa0 (diff)
downloadpodman-6b517a7e9077330bfe81d84401aa856e2fab380c.tar.gz
podman-6b517a7e9077330bfe81d84401aa856e2fab380c.tar.bz2
podman-6b517a7e9077330bfe81d84401aa856e2fab380c.zip
Merge pull request #10668 from zhangguanzhang/panic-cgroup
[NO TESTS NEEDED] Fixes panic condition in cgroups.getAvailableControllers
-rw-r--r--pkg/cgroups/cgroups.go5
1 files changed, 2 insertions, 3 deletions
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)
}