static void kvm_vcpu_uninit(struct kvm_vcpu *vcpu)
{
- /*
- * no need for rcu_read_lock as VCPU_RUN is the only place that
- * will change the vcpu->pid pointer and on uninit all file
- * descriptors are already gone.
- */
- put_pid(rcu_dereference_protected(vcpu->pid, 1));
free_page((unsigned long)vcpu->run);
}
{
kvm_arch_vcpu_destroy(vcpu);
+ /*
+ * No need for rcu_read_lock as VCPU_RUN is the only place that changes
+ * the vcpu->pid pointer, and at destruction time all file descriptors
+ * are already gone.
+ */
+ put_pid(rcu_dereference_protected(vcpu->pid, 1));
+
kvm_vcpu_uninit(vcpu);
kmem_cache_free(kvm_vcpu_cache, vcpu);
}