From 650e5db5a2df96e8dc7a267e6831dbcce1bce9dc Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 7 Feb 2018 18:13:22 +0100 Subject: [PATCH] usbxhci: fix mistake in completering() the td index "x" was incremented twice, once in for loop and in the body expression. so r->rp only got updated every second completion. this is wrong, but harmless. --- sys/src/9/pc/usbxhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/9/pc/usbxhci.c b/sys/src/9/pc/usbxhci.c index 8925df257..489de15a3 100644 --- a/sys/src/9/pc/usbxhci.c +++ b/sys/src/9/pc/usbxhci.c @@ -800,7 +800,7 @@ completering(Ring *r, u32int *er) pa = (*(u64int*)er) & ~15ULL; ilock(r); - for(x = r->rp; (int)(r->wp - x) > 0; x++){ + for(x = r->rp; (int)(r->wp - x) > 0;){ td = &r->base[4*(x++ & r->mask)]; if((u64int)PADDR(td) == pa){ r->rp = x;