Re: [PATCH kernel] KVM: Don't null dereference ops->destroy
Paolo Bonzini <[email protected]>
| Newsgroups | org.kernel.vger.kvm-ppc,org.kernel.vger.kvm |
|---|---|
| Message-ID | <[email protected]> |
On 5/31/22 06:32, Alexey Kardashevskiy wrote: >> - ops->destroy(dev); >> + if (ops->destroy) >> + ops->destroy(dev); > > > btw why is destroy() not under the kvm->lock here? The comment in > kvm_destroy_devices() suggests that it is an exception there but not > necessarily here. Thanks, The comment refers to walking the list. The ops->destroy contract is that it's called outside kvm->lock, and that's followed in both places (both before and after the suggested patch). Paolo