ia64/xen-unstable

changeset 11353:926d7b131689

[XEN] physdev: Check for negative irqs in alloc_irq_vector.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
author kaf24@firebug.cl.cam.ac.uk
date Wed Aug 30 18:02:32 2006 +0100 (2006-08-30)
parents dc883b5e906e
children 45f6ee334fcc
files xen/arch/x86/physdev.c
line diff
     1.1 --- a/xen/arch/x86/physdev.c	Wed Aug 30 17:56:49 2006 +0100
     1.2 +++ b/xen/arch/x86/physdev.c	Wed Aug 30 18:02:32 2006 +0100
     1.3 @@ -96,10 +96,11 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
     1.4          if ( !IS_PRIV(current->domain) )
     1.5              break;
     1.6  
     1.7 +        irq = irq_op.irq;
     1.8          ret = -EINVAL;
     1.9 -        if ( (irq = irq_op.irq) >= NR_IRQS )
    1.10 +        if ( (irq < 0) || (irq >= NR_IRQS) )
    1.11              break;
    1.12 -        
    1.13 +
    1.14          irq_op.vector = assign_irq_vector(irq);
    1.15          ret = copy_to_guest(arg, &irq_op, 1) ? -EFAULT : 0;
    1.16          break;