KVM: selftests: Fix kvm_vm_free() in cr4_cpuid_sync and vmx_tsc_adjust tests
PATCH 1/1 KVM: selftests: Fix kvm_vm_free() in cr4_cpuid_sync and vmx_tsc_adjust tests
The kvm_vm_free() statement here is currently dead code, since the loop in front of it can only be left with the "goto done" that jumps right after the kvm_vm_free(). Fix it by swapping the locations of the "done" label and the kvm_vm_free().
Signed-off-by Thomas Huth <[email protected]>
--- tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c | 3 +-- tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c +1 -2
@@ -109,8 +109,7 @@ int main(int argc, char *argv[]) } } -kvm_vm_free (vm); - done: +kvm_vm_free (vm);return 0 ; }
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c +1 -1
@@ -161,7 +161,7 @@ int main(int argc, char *argv[]) } } -kvm_vm_free (vm); done: +kvm_vm_free (vm);return 0 ; }
Signature · 1 line
2.27.0
Quoted 31 lines · Thomas Huth
The
kvm_vm_free()statement here is currently dead code, since the loop in front of it can only be left with the "goto done" that jumps right after thekvm_vm_free(). Fix it by swapping the locations of the "done" label and thekvm_vm_free().Signed-off-by Thomas Huth <[email protected]>--- tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c | 3 +-- tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c +1
-2@@ -109,8 +109,7 @@ int main(int argc, char *argv[]) } } -kvm_vm_free (vm); - done: +kvm_vm_free (vm);return 0 ; }tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c +0
-0
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c int main(int argc, char *argv[]) · line 167
Quoted 8 lines
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c +1
-1@@ -161,7 +161,7 @@ int main(int argc, char *argv[]) } } -kvm_vm_free (vm); done: +kvm_vm_free (vm);return 0 ; }
Queued, thanks.
Paolo