# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1301132521 0
# Node ID 48dac730a93b27ff60a340564e9a7afd7f9385f4
# Parent  8f001d864fefac689b7662bc9979eaddf4fd6e9c
x86: __pirq_guest_eoi() must check it is called for a fully
guest-bound irq before accessing desc->action.

Signed-off-by: Keir Fraser <keir@xen.org>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1022,6 +1022,12 @@ static void __pirq_guest_eoi(struct doma
     if ( desc == NULL )
         return;
 
+    if ( !(desc->status & IRQ_GUEST) )
+    {
+        spin_unlock_irq(&desc->lock);
+        return;
+    }
+
     action = (irq_guest_action_t *)desc->action;
     irq = desc - irq_desc;