mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
[XEN] physdev: Check for negative irqs in alloc_irq_vector.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
1 parent
c398044d5d
commit
4a83022207
1 file changed
+3
-2
@@ -96,10 +96,11 @@ long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
|
||||
if ( !IS_PRIV(current->domain) )
|
||||
break;
|
||||
|
||||
irq = irq_op.irq;
|
||||
ret = -EINVAL;
|
||||
if ( (irq = irq_op.irq) >= NR_IRQS )
|
||||
if ( (irq < 0) || (irq >= NR_IRQS) )
|
||||
break;
|
||||
|
||||
|
||||
irq_op.vector = assign_irq_vector(irq);
|
||||
ret = copy_to_guest(arg, &irq_op, 1) ? -EFAULT : 0;
|
||||
break;
|
||||
|
||||