KVM: x86: check existance before destroy
Mostly used for split irqchip mode. In that case, these two things are not inited at all, so no need to release. Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
parent
df630b8c1e
commit
950712eb8e
@ -657,6 +657,9 @@ void kvm_pic_destroy(struct kvm *kvm)
|
||||
{
|
||||
struct kvm_pic *vpic = kvm->arch.vpic;
|
||||
|
||||
if (!vpic)
|
||||
return;
|
||||
|
||||
kvm_io_bus_unregister_dev(vpic->kvm, KVM_PIO_BUS, &vpic->dev_master);
|
||||
kvm_io_bus_unregister_dev(vpic->kvm, KVM_PIO_BUS, &vpic->dev_slave);
|
||||
kvm_io_bus_unregister_dev(vpic->kvm, KVM_PIO_BUS, &vpic->dev_eclr);
|
||||
|
@ -635,6 +635,9 @@ void kvm_ioapic_destroy(struct kvm *kvm)
|
||||
{
|
||||
struct kvm_ioapic *ioapic = kvm->arch.vioapic;
|
||||
|
||||
if (!ioapic)
|
||||
return;
|
||||
|
||||
cancel_delayed_work_sync(&ioapic->eoi_inject);
|
||||
kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &ioapic->dev);
|
||||
kvm->arch.vioapic = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user