From 4fc13cdd26b38bd4bb88e3f8b2a39f3103808205 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Dec 2024 13:02:00 +0100 Subject: [PATCH] group1: cpusetController.getValues: don't use naked returns Explicitly return nil instead of potentially returning a partial result (only cpus or mems). Signed-off-by: Sebastiaan van Stijn --- cgroup1/cpuset.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgroup1/cpuset.go b/cgroup1/cpuset.go index 242f77ed..03705beb 100644 --- a/cgroup1/cpuset.go +++ b/cgroup1/cpuset.go @@ -87,10 +87,10 @@ func (c *cpusetController) Update(path string, resources *specs.LinuxResources) func (c *cpusetController) getValues(path string) (cpus []byte, mems []byte, err error) { if cpus, err = os.ReadFile(filepath.Join(path, "cpuset.cpus")); err != nil && !os.IsNotExist(err) { - return + return nil, nil, err } if mems, err = os.ReadFile(filepath.Join(path, "cpuset.mems")); err != nil && !os.IsNotExist(err) { - return + return nil, nil, err } return cpus, mems, nil }