summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Faizi <ammar.faizi@students.amikom.ac.id>2021-10-07 13:31:53 +0700
committerJens Axboe <axboe@kernel.dk>2021-10-07 06:23:42 -0600
commitc6f063cff1291c9972d0563dfc1ce3f1ebc8859c (patch)
treef16314a93adc55a2c0d186f9919c2bb3455fddf4
parent326ed975d49e8c7bff071abe8e7ac5e0c0196622 (diff)
downloadliburing-c6f063cff1291c9972d0563dfc1ce3f1ebc8859c.tar.gz
liburing-c6f063cff1291c9972d0563dfc1ce3f1ebc8859c.tar.bz2
test/{iopoll,read-write}: Use `io_uring_free_probe()` instead of `free()`
`io_uring_free_probe()` should really be used to free the return value of `io_uring_get_probe_ring()`. As we may not always allocate it with `malloc()`. For example, to support no libc build [1]. Link: https://github.com/axboe/liburing/issues/443 [1] Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/iopoll.c2
-rw-r--r--test/read-write.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/iopoll.c b/test/iopoll.c
index de36473..4bfc26a 100644
--- a/test/iopoll.c
+++ b/test/iopoll.c
@@ -306,7 +306,7 @@ static int probe_buf_select(void)
fprintf(stdout, "Buffer select not supported, skipping\n");
return 0;
}
- free(p);
+ io_uring_free_probe(p);
return 0;
}
diff --git a/test/read-write.c b/test/read-write.c
index 885905b..d54ad0e 100644
--- a/test/read-write.c
+++ b/test/read-write.c
@@ -480,7 +480,7 @@ static int test_buf_select(const char *filename, int nonvec)
fprintf(stdout, "Buffer select not supported, skipping\n");
return 0;
}
- free(p);
+ io_uring_free_probe(p);
/*
* Write out data with known pattern