diff options
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.c')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/arch/amd64/driver/util.c b/src/kernel/arch/amd64/driver/util.c index 1462258..0f0ee34 100644 --- a/src/kernel/arch/amd64/driver/util.c +++ b/src/kernel/arch/amd64/driver/util.c @@ -42,7 +42,10 @@ void postqueue_ringreadall(VfsReq **queue, ring_t *r) { mlen = min(mlen, sizeof tmp); mlen = ring_get(r, tmp, mlen); - for (req = *queue; req; req = req->postqueue_next) { + while (*queue) { + req = *queue; + *queue = req->postqueue_next; + size_t ret = min(mlen, req->output.len); assert(req->type == VFSOP_READ); if (req->caller) { @@ -50,7 +53,6 @@ void postqueue_ringreadall(VfsReq **queue, ring_t *r) { } vfsreq_finish_short(req, ret); } - *queue = NULL; } size_t ring_to_virt(ring_t *r, Proc *proc, void __user *ubuf, size_t max) { |