Skip to contentSkip to conversation

fix process_portio_intercept

PATCH New Stefano Stabellini 1 participant 1 message Apr 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix process_portio_intercept

Hi all,
process_portio_intercept and hvm_mmio_access do not correctly check the return value of the intercept action functions they are calling. In particular they are setting p->count to i even if i is 0 and the action function returned X86EMUL_UNHANDLEABLE, leading to errors.

---

xen/arch/x86/hvm/intercept.c +6 -2
diff -r dbc4014882d0 xen/arch/x86/hvm/intercept.c
@@ -100,8 +100,10 @@
         }
     }
 
-    if ( (p->count = i) != 0 )
+    if ( i > 0 ) {
+        p->count = i;
         rc = X86EMUL_OKAY;
+    }
 
     return rc;
 }
@@ -165,8 +167,10 @@
         }
     }
 
-    if ( (p->count = i) != 0 )
+    if ( i > 0 ) {
+        p->count = i;
         rc = X86EMUL_OKAY;
+    }
 
     return rc;
 }