aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/i8259.c
diff options
context:
space:
mode:
authorBen-Ami Yassour <benami@il.ibm.com>2008-07-06 10:15:07 -0400
committerAvi Kivity <avi@qumranet.com>2008-07-20 05:42:39 -0400
commitc65bbfa1d693d375da51f9c8aa9fb26f09fa19ed (patch)
tree9046a4a8d38b2dc33ca45c975ce52d34ecde1cd0 /arch/x86/kvm/i8259.c
parent19fdfa0d133ae216e9d1c69a8333fe63fcf8e584 (diff)
KVM: check injected pic irq within valid pic irqs
Check that an injected pic irq is between 0 and 15. Signed-off-by: Ben-Ami Yassour <benami@il.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/i8259.c')
-rw-r--r--arch/x86/kvm/i8259.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 5857f59ad4aa..c31164e8aa46 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -130,8 +130,10 @@ void kvm_pic_set_irq(void *opaque, int irq, int level)
130{ 130{
131 struct kvm_pic *s = opaque; 131 struct kvm_pic *s = opaque;
132 132
133 pic_set_irq1(&s->pics[irq >> 3], irq & 7, level); 133 if (irq >= 0 && irq < PIC_NUM_PINS) {
134 pic_update_irq(s); 134 pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
135 pic_update_irq(s);
136 }
135} 137}
136 138
137/* 139/*