aboutsummaryrefslogtreecommitdiff
path: root/hw/display/xenfb.c
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2016-04-12 11:43:14 +0100
committerStefano Stabellini <sstabellini@kernel.org>2016-04-12 10:16:08 -0700
commit4df26e88ee2f23c01418630368e87b719ed06b75 (patch)
treeb000d467c3a85007f0c08e94202798eab14648f6 /hw/display/xenfb.c
parent42bb626f7ebc9197d2943b897a99e127315275ab (diff)
downloadqemu-4df26e88ee2f23c01418630368e87b719ed06b75.zip
qemu-4df26e88ee2f23c01418630368e87b719ed06b75.tar.gz
qemu-4df26e88ee2f23c01418630368e87b719ed06b75.tar.bz2
xenfb: use the correct condition to avoid excessive looping
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 ">". 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>
Diffstat (limited to 'hw/display/xenfb.c')
-rw-r--r--hw/display/xenfb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 40b096a..9866dfd 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -775,7 +775,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 */