Merge pull request #12079 from stweil/lgtm

[NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
This commit is contained in:
OpenShift Merge Robot 2021-10-25 10:58:50 +00:00 committed by GitHub
commit dbe770e3ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -332,7 +332,7 @@ func readKernelVersion() (string, error) {
return "", err
}
f := bytes.Fields(buf)
if len(f) < 2 {
if len(f) < 3 {
return string(bytes.TrimSpace(buf)), nil
}
return string(f[2]), nil