aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorGravatar Avi Kivity <avi@redhat.com> 2010-07-27 14:51:44 +0300
committerGravatar Marcelo Tosatti <mtosatti@redhat.com> 2010-09-08 14:50:56 -0300
commitae0635b3580844e320a253a16985f4ce8b5bd0b6 (patch)
treecbb5d9c113a9b69cb6438664f7eed1137b6f3fdf /arch
parentKVM: x86 emulator: fix regression with cmpxchg8b on i386 hosts (diff)
downloadlinux-ae0635b3580844e320a253a16985f4ce8b5bd0b6.tar.gz
linux-ae0635b3580844e320a253a16985f4ce8b5bd0b6.tar.bz2
linux-ae0635b3580844e320a253a16985f4ce8b5bd0b6.zip
KVM: fix i8259 oops when no vcpus are online
If there are no vcpus, found will be NULL. Check before doing anything with it. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/i8259.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 8d10c063d7f2..4b7b73ce2098 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -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);
}
}