From: "Jan Beulich" Subject: [PATCH] two more fixes for c/s 19419 Date: Wed, 01 Apr 2009 13:54:24 +0100 Message-ID: <49D38020.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Gang Wei List-Id: xen-devel@lists.xenproject.org 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 --- 2009-03-27.orig/xen/arch/x86/hpet.c 2009-04-01 11:28:25.000000000 = +0200 +++ 2009-03-27/xen/arch/x86/hpet.c 2009-04-01 14:02:18.000000000 = +0200 @@ -45,7 +45,7 @@ static unsigned int num_hpets_used; /* m =20 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); =20 -static int vector_channel[NR_IRQS] =3D {[0 ... NR_IRQS-1] =3D -1}; +static int vector_channel[NR_VECTORS] =3D {[0 ... NR_VECTORS-1] =3D -1}; =20 #define vector_to_channel(vector) vector_channel[vector] =20 @@ -345,6 +345,9 @@ static int hpet_assign_irq(struct hpet_e { unsigned int vector; =20 + if ( ch->vector ) + return 0; + vector =3D assign_irq_vector(AUTO_ASSIGN_IRQ); if ( (int)vector < 0 ) return vector;