[PATCH liburing 1/2] Revert "test/buf-ring: ensure cqe isn't used uninitialized"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reverts commit d6f9e02f9c6a777010824341f14c994b11dfc8b1.

"io_uring: add buffer selection support to IORING_OP_NOP" has been
reverted from 5.19, which this relies on

Signed-off-by: Dylan Yudaken <dylany@xxxxxx>
---
 test/buf-ring.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/buf-ring.c b/test/buf-ring.c
index af1cac8..2fcc360 100644
--- a/test/buf-ring.c
+++ b/test/buf-ring.c
@@ -234,19 +234,22 @@ static int test_one_nop(int bgid, struct io_uring *ring)
 		ret = -1;
 		goto out;
 	}
-	ret = cqe->res;
-	io_uring_cqe_seen(ring, cqe);
 
-	if (ret == -ENOBUFS)
-		return ret;
+	if (cqe->res == -ENOBUFS) {
+		ret = cqe->res;
+		goto out;
+	}
 
-	if (ret != 0) {
+	if (cqe->res != 0) {
 		fprintf(stderr, "nop result %d\n", ret);
-		return -1;
+		ret = -1;
+		goto out;
 	}
 
 	ret = cqe->flags >> 16;
+
 out:
+	io_uring_cqe_seen(ring, cqe);
 	return ret;
 }
 
-- 
2.30.2





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux