summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/ioapic.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-03-15 09:01:18 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-03-23 19:02:03 +0100
commit950712eb8ef03e4a62ac5b3067efde7ec2f8a91e (patch)
treebbc3b0839d6f86d70cd604e9e057ed67dddfa059 /arch/x86/kvm/ioapic.c
parentKVM: x86: clear bus pointer when destroyed (diff)
downloadlinux-950712eb8ef03e4a62ac5b3067efde7ec2f8a91e.tar.xz
linux-950712eb8ef03e4a62ac5b3067efde7ec2f8a91e.zip
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>
Diffstat (limited to 'arch/x86/kvm/ioapic.c')
-rw-r--r--arch/x86/kvm/ioapic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 6e219e5c07d2..289270a6aecb 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -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;