mirror of
https://github.com/adulau/aha.git
synced 2024-12-31 21:26:18 +00:00
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>
This commit is contained in:
parent
19fdfa0d13
commit
c65bbfa1d6
2 changed files with 6 additions and 2 deletions
|
@ -130,8 +130,10 @@ void kvm_pic_set_irq(void *opaque, int irq, int level)
|
|||
{
|
||||
struct kvm_pic *s = opaque;
|
||||
|
||||
pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
|
||||
pic_update_irq(s);
|
||||
if (irq >= 0 && irq < PIC_NUM_PINS) {
|
||||
pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
|
||||
pic_update_irq(s);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "ioapic.h"
|
||||
#include "lapic.h"
|
||||
|
||||
#define PIC_NUM_PINS 16
|
||||
|
||||
struct kvm;
|
||||
struct kvm_vcpu;
|
||||
|
||||
|
|
Loading…
Reference in a new issue