Commit 4df26e88 authored by Wei Liu's avatar Wei Liu Committed by Stefano Stabellini
Browse files

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: default avatar"Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
Tested-by: default avatar"Hao, Xudong" <xudong.hao@intel.com>
Acked-by: default avatarAnthony Perard <anthony.perard@citrix.com>
Signed-off-by: default avatarStefano Stabellini <sstabellini@kernel.org>
parent 42bb626f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */