aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-07-04 14:03:10 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-07-06 18:39:19 +0200
commit960a479f7f94bb615991d41b8c5ff4e3c7d0088d (patch)
tree7f4a7274909d5fc412a65fb1dbfe501f76695087 /hw/intc
parentea3d77c889cfa8c450da8a716c2bfd6aaea0adb2 (diff)
ioapic: remove useless lower bounds check
The vector cannot be negative. Coverity now reports this because it sees an array access before the check, in ioapic_stat_update_irq. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/ioapic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index b3937807c2..b6896ac4ce 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -152,7 +152,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
if (vector == 0) {
vector = 2;
}
- if (vector >= 0 && vector < IOAPIC_NUM_PINS) {
+ if (vector < IOAPIC_NUM_PINS) {
uint32_t mask = 1 << vector;
uint64_t entry = s->ioredtbl[vector];