From: Avi Kivity Date: Tue, 27 Jul 2010 11:51:44 +0000 (+0300) Subject: KVM: fix i8259 oops when no vcpus are online X-Git-Tag: firefly_0821_release~9833^2~541^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ae0635b3580844e320a253a16985f4ce8b5bd0b6;p=firefly-linux-kernel-4.4.55.git 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 --- 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); } }