]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
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 8d10c063d7f207451b087a11a8d7bf0c888f3695..4b7b73ce209894442eddd9df2b8f076408389b12 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);
        }
 }