[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] ioapic: remove useless lower bounds check
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH] ioapic: remove useless lower bounds check |
Date: |
Wed, 4 Jul 2018 14:04:12 +0200 |
The vector cannot be negative. Coverity now reports this because it sees an
array access before the check, in ioapic_stat_update_irq.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/intc/ioapic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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];
--
2.17.1
- [Qemu-devel] [PATCH] ioapic: remove useless lower bounds check,
Paolo Bonzini <=