From 652bb76ddeb87b1f1405c24cb63b1b8604bc8d36 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Tue, 24 Dec 2019 23:25:19 -0800 Subject: [PATCH] cli: syscall return value check is wrong 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 --- cli/kata-check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/kata-check.go b/cli/kata-check.go index 9ffed062da..683d2619f1 100644 --- a/cli/kata-check.go +++ b/cli/kata-check.go @@ -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 }