]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: selftests: Fix kvm_vm_free() in cr4_cpuid_sync and vmx_tsc_adjust tests
authorThomas Huth <thuth@redhat.com>
Thu, 26 Aug 2021 07:49:28 +0000 (09:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Sep 2021 08:27:08 +0000 (04:27 -0400)
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 <thuth@redhat.com>
Message-Id: <20210826074928.240942-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c

index f40fd097cb35939043eb574e1b9d067186fdd1d9..6f6fd189dda3f8c6f31aaf4c6b20a06e30d3df4d 100644 (file)
@@ -109,8 +109,7 @@ int main(int argc, char *argv[])
                }
        }
 
-       kvm_vm_free(vm);
-
 done:
+       kvm_vm_free(vm);
        return 0;
 }
index 7e33a350b053a53fc0644d6f31bb857b4fa993f6..e683d0ac3e45e1841281e87078bfda7edc91b6b6 100644 (file)
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
                }
        }
 
-       kvm_vm_free(vm);
 done:
+       kvm_vm_free(vm);
        return 0;
 }