KVM: fix i8259 oops when no vcpus are online
authorAvi Kivity <avi@redhat.com>
Tue, 27 Jul 2010 11:51:44 +0000 (14:51 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 8 Sep 2010 17:50:56 +0000 (14:50 -0300)
If there are no vcpus, found will be NULL.  Check before doing anything with
it.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/i8259.c

index 8d10c06..4b7b73c 100644 (file)
@@ -64,6 +64,9 @@ static void pic_unlock(struct kvm_pic *s)
                if (!found)
                        found = s->kvm->bsp_vcpu;
 
+               if (!found)
+                       return;
+
                kvm_vcpu_kick(found);
        }
 }