]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: fix OOPS on flush_work
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Oct 2016 11:35:56 +0000 (13:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Oct 2016 12:06:51 +0000 (14:06 +0200)
commitce3676ccdbe3fed2f1ff521e1951e832d2b482fb
treec32e2452c7269e97ef001eb8f8428a106e9434cf
parente31e9f2076fbe5da466036e4f1d63ca73224880b
KVM: fix OOPS on flush_work

The conversion done by commit ce26b0a9645e ("KVM: Remove deprecated
create_singlethread_workqueue") is broken.  It flushes a single work
item &irqfd->shutdown instead of all of them, and even worse if there
is no irqfd on the list then you get a NULL pointer dereference.
Revert the virt/kvm/eventfd.c part of that patch; to avoid the
deprecated function, just allocate our own workqueue---it does
not even have to be unbound---with alloc_workqueue.

Fixes: ce26b0a9645e
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/eventfd.c
virt/kvm/kvm_main.c