KVM: selftests: Fix VM leak in early return
PATCH 1/1 KVM: selftests: Fix VM leak in early return
test_mmio_ease() returns early and skips the call to kvm_vm_free() when ID_AA64PFR1_EL1 is not available.
Use a goto so that the early return joins the common exit path.
Reported-by Gokul K <[email protected]>
Fixes a90aac553249 ("KVM: arm64: selftests: Test SEAs are taken to SError vector when EASE=1")
Signed-off-by Tharit Tangkijwanichakul <[email protected]>
---
Tested on a Rock 5B (RK3588). ID_AA64PFR1_EL1.DF2 is not implemented, so test_mmio_ease() takes the skip path exercised by this fix.
--- tools/testing/selftests/kvm/arm64/external_aborts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/kvm/arm64/external_aborts.c +2 -1
@@ -339,7 +339,7 @@ static void test_mmio_ease(void) pfr1 =vcpu_get_reg (vcpu,KVM_ARM64_SYS_REG (SYS_ID_AA64PFR1_EL1 ));if (!SYS_FIELD_GET (ID_AA64PFR1_EL1 ,DF2 , pfr1)) {pr_debug ("Skipping %s\n" , __func__); -return ; + goto done; }/*
@@ -356,6 +356,7 @@ static void test_mmio_ease(void)vcpu_inject_sea (vcpu);vcpu_run_expect_done (vcpu); +done:kvm_vm_free (vm); }
Signature · 1 line
2.47.3
Quoted 4 lines · Tharit Tangkijwanichakul
test_mmio_ease()returns early and skips the call tokvm_vm_free()whenID_AA64PFR1_EL1is not available.Use a goto so that the early return joins the common exit path.
Applied to next, thanks!
[1/1] KVM: selftests: Fix VM leak in early return
commit: bb6c7d2bf564cdaa24b14764b7126f5cab45965a
Cheers,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.