Skip to content

Commit

Permalink
group1: cpusetController.getValues: don't use naked returns
Browse files Browse the repository at this point in the history
Explicitly return nil instead of potentially returning a partial
result (only cpus or mems).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Dec 10, 2024
1 parent d4e976d commit 4fc13cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cgroup1/cpuset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4fc13cd

Please sign in to comment.