提交 4df26e88 编写于 作者: W Wei Liu 提交者: Stefano Stabellini

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: N"Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: NWei Liu <wei.liu2@citrix.com>
Tested-by: N"Hao, Xudong" <xudong.hao@intel.com>
Acked-by: NAnthony Perard <anthony.perard@citrix.com>
Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
上级 42bb626f
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册