]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
xenfb: use the correct condition to avoid excessive looping qemu-xen-4.7.0-rc1
authorWei Liu <wei.liu2@citrix.com>
Tue, 12 Apr 2016 10:43:14 +0000 (11:43 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Fri, 22 Apr 2016 10:27:31 +0000 (11:27 +0100)
In commit ac0487e1 ("xenfb.c: avoid expensive loops when prod <=
out_cons"), ">=" was used. In fact, a full ring is a legit state.
Correct the test to use ">".

upstream-commit-id: 4df26e88ee2f23c01418630368e87b719ed06b75

Reported-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: "Hao, Xudong" <xudong.hao@intel.com>
Acked-by: Anthony Perard <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/display/xenfb.c

index 8eb30462440e37d6b639144899db7892b38329d6..284b3456c8410fa9bb7359f5b2b305a6ac34cfa6 100644 (file)
@@ -789,7 +789,7 @@ static void xenfb_handle_events(struct XenFB *xenfb)
 
     prod = page->out_prod;
     out_cons = page->out_cons;
-    if (prod - out_cons >= XENFB_OUT_RING_LEN) {
+    if (prod - out_cons > XENFB_OUT_RING_LEN) {
         return;
     }
     xen_rmb();         /* ensure we see ring contents up to prod */