test/buf-ring: ensure cqe isn't used uninitialized
Fixes: ("buf-ring: add tests that cycle through the provided buffer ring")
@@ -234,22 +234,19 @@ static int test_one_nop(int bgid, struct io_uring *ring)
ret = -1;
goto out;
}
-
- if (cqe->res == -ENOBUFS) {
ret = cqe->res;
- goto out;
- }
+ io_uring_cqe_seen(ring, cqe);
+
+ if (ret == -ENOBUFS)
+ return ret;
- if (cqe->res != 0) {
+ if (ret != 0) {
fprintf(stderr, "nop result %d\n", ret);
- ret = -1;
- goto out;
+ return -1;
}
ret = cqe->flags >> 16;
-
out:
- io_uring_cqe_seen(ring, cqe);
return ret;
}
