Skip to content

Commit b2c9a85

Browse files
Marc Zyngierchazy
authored andcommitted
KVM: arm/arm64: vgic: Move kvm_vgic_destroy call around
The way we call kvm_vgic_destroy is a bit bizarre. We call it *after* having freed the vcpus, which sort of defeats the point of cleaning up things before that point. Let's move kvm_vgic_destroy towards the beginning of kvm_arch_destroy_vm, which seems more sensible. Acked-by: Christoffer Dall <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Christoffer Dall <[email protected]>
1 parent 7129a9d commit b2c9a85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

virt/kvm/arm/arm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
177177
{
178178
int i;
179179

180+
kvm_vgic_destroy(kvm);
181+
180182
free_percpu(kvm->arch.last_vcpu_ran);
181183
kvm->arch.last_vcpu_ran = NULL;
182184

@@ -186,8 +188,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
186188
kvm->vcpus[i] = NULL;
187189
}
188190
}
189-
190-
kvm_vgic_destroy(kvm);
191191
}
192192

193193
int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)

0 commit comments

Comments
 (0)