Skip to content

Commit

Permalink
KVM: arm/arm64: vgic: Move kvm_vgic_destroy call around
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Marc Zyngier authored and chazy committed Nov 6, 2017
1 parent 7129a9d commit b2c9a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virt/kvm/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
{
int i;

kvm_vgic_destroy(kvm);

free_percpu(kvm->arch.last_vcpu_ran);
kvm->arch.last_vcpu_ran = NULL;

Expand All @@ -186,8 +188,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
kvm->vcpus[i] = NULL;
}
}

kvm_vgic_destroy(kvm);
}

int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
Expand Down

0 comments on commit b2c9a85

Please sign in to comment.