浏览代码

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>
Avi Kivity 15 年之前
父节点
当前提交
ae0635b358
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/x86/kvm/i8259.c

+ 3 - 0
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);
 	}
 }