mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
kvm: free resources after canceling async_pf
When we cancel 'async_pf_execute()', we should behave as if the work was never scheduled in 'kvm_setup_async_pf()'. Fixes a bug when we can't unload module because the vm wasn't destroyed. Signed-off-by: Radim Krčmář <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Gleb Natapov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
parent
72f857950f
commit
28b441e240
1 changed files with 4 additions and 1 deletions
|
|
@ -101,8 +101,11 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
|
|||
typeof(*work), queue);
|
||||
cancel_work_sync(&work->work);
|
||||
list_del(&work->queue);
|
||||
if (!work->done) /* work was canceled */
|
||||
if (!work->done) { /* work was canceled */
|
||||
mmdrop(work->mm);
|
||||
kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */
|
||||
kmem_cache_free(async_pf_cache, work);
|
||||
}
|
||||
}
|
||||
|
||||
spin_lock(&vcpu->async_pf.lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue