projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea3d77c
)
ioapic: remove useless lower bounds check
author
Paolo Bonzini
<pbonzini@redhat.com>
Wed, 4 Jul 2018 12:03:10 +0000
(14:03 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Fri, 6 Jul 2018 16:39:19 +0000
(18:39 +0200)
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>
hw/intc/ioapic.c
patch
|
blob
|
history
diff --git
a/hw/intc/ioapic.c
b/hw/intc/ioapic.c
index b3937807c227344b3f2e99a2f7360b95f3381cea..b6896ac4ce262049e4db3e98b50fd9ea75efd44c 100644
(file)
--- 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];