From 4df26e88ee2f23c01418630368e87b719ed06b75 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 12 Apr 2016 11:43:14 +0100 Subject: 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" Signed-off-by: Wei Liu Tested-by: "Hao, Xudong" Acked-by: Anthony Perard Signed-off-by: Stefano Stabellini --- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 40b096afa2..9866dfda5f 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 */ -- cgit v1.2.3