diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-04-01 14:04:46 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-04-01 14:04:46 +0100 |
commit | 885b76a5fbdedcebc15b52aaa9711c9da8fd8026 (patch) | |
tree | 8839568a128b06a2b5cbf0465f9b9f7916376d88 | |
parent | a21645e1dff35eaec69f2eb9c61adeafbb16c971 (diff) | |
download | xen-885b76a5fbdedcebc15b52aaa9711c9da8fd8026.tar.gz xen-885b76a5fbdedcebc15b52aaa9711c9da8fd8026.tar.bz2 xen-885b76a5fbdedcebc15b52aaa9711c9da8fd8026.zip |
x86 hpet: two more fixes for c/s 19419
vector_channel[], as its name already says, is vector-, not
irq-indexed.
hpet_assign_irq() sits not only in the boot path, but also in the
resume one. Short of knowing why this is, simply checking whether a
vector was already assigned prevents leaking previously assigned ones.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
-rw-r--r-- | xen/arch/x86/hpet.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index ea7c5be144..7671634ef2 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -45,7 +45,7 @@ static unsigned int num_hpets_used; /* msi hpet channels used for broadcast */ DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); -static int vector_channel[NR_IRQS] = {[0 ... NR_IRQS-1] = -1}; +static int vector_channel[NR_VECTORS] = {[0 ... NR_VECTORS-1] = -1}; #define vector_to_channel(vector) vector_channel[vector] @@ -345,6 +345,9 @@ static int hpet_assign_irq(struct hpet_event_channel *ch) { int vector; + if ( ch->vector ) + return 0; + if ( (vector = assign_irq_vector(AUTO_ASSIGN_IRQ)) < 0 ) return vector; |