Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
cli: syscall return value check is wrong
Browse files Browse the repository at this point in the history
ret is uintptr and always >= 0. errno is enough for error checking.
This is causing lint error:
/home/vagrant/workplace/golang/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check.go:446:20: SA4003: no value of type uintptr is less than 0 (staticcheck)
                if errno != 0 || ret <= 0 {
                                 ^

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
  • Loading branch information
bergwolf committed Dec 25, 2019
1 parent a871728 commit 652bb76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/kata-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func genericCheckKVMExtensions(extensions map[string]kvmExtension) (map[string]i

// Generally return value(ret) 0 means no and 1 means yes,
// but some extensions may report additional information in the integer return value.
if errno != 0 || ret <= 0 {
if errno != 0 {
kataLog.WithFields(fields).Error("is not supported")
return results, errno
}
Expand Down

0 comments on commit 652bb76

Please sign in to comment.