main() creates the VM before asking whether it has the PMU feature, and when it does not, returns KSFT_SKIP directly. That skips the done: label through which every other exit frees the VM. Set ret and jump there instead. Fixes: 11c840192768 ("KVM: LoongArch: selftests: Add basic PMU event counting test") Signed-off-by: Gokul K --- tools/testing/selftests/kvm/loongarch/pmu_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/loongarch/pmu_test.c b/tools/testing/selftests/kvm/loongarch/pmu_test.c index ec3fefb9ea97..c9dd3cf5de06 100644 --- a/tools/testing/selftests/kvm/loongarch/pmu_test.c +++ b/tools/testing/selftests/kvm/loongarch/pmu_test.c @@ -176,7 +176,8 @@ int main(int argc, char *argv[]) pr_info("PMU is enabled in VM\n"); } else { print_skip("PMU not enabled by VM config\n"); - return KSFT_SKIP; + ret = KSFT_SKIP; + goto done; } while (1) { -- 2.54.0