Skip to content

Commit

Permalink
test/read-mshot*: cleanup up properly
Browse files Browse the repository at this point in the history
Either missing a queue exit, buffer ring exit, or both. Add them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Oct 6, 2024
1 parent 0f72d92 commit a0e3a45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/read-mshot-empty.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ int main(int argc, char *argv[])
}

pthread_join(thread, &tret);
io_uring_free_buf_ring(&ring, br, NR_BUFS, BGID);
io_uring_queue_exit(&ring);
free(buf);
return T_EXIT_PASS;
}
6 changes: 6 additions & 0 deletions test/read-mshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static int test_inc(int use_mshot, int flags)
}
}

io_uring_free_buf_ring(&ring, br, 32, BUF_BGID);
io_uring_queue_exit(&ring);
free(ptr);
close(fds[0]);
close(fds[1]);
Expand Down Expand Up @@ -254,6 +256,7 @@ static int test_clamp(void)
io_uring_cqe_seen(&ring, cqe);
}

io_uring_free_buf_ring(&ring, br, NR_BUFS, BUF_BGID);
io_uring_queue_exit(&ring);
free(ptr);
return 0;
Expand Down Expand Up @@ -408,6 +411,8 @@ static int test(int first_good, int async, int overflow, int incremental)
io_uring_cqe_seen(&ring, cqe);
}


io_uring_free_buf_ring(&ring, br, NR_BUFS, BUF_BGID);
io_uring_queue_exit(&ring);
if (incremental) {
free(ptr[0]);
Expand Down Expand Up @@ -483,6 +488,7 @@ static int test_invalid(int async)
}

io_uring_cqe_seen(&ring, cqe);
io_uring_free_buf_ring(&ring, br, 1, BUF_BGID);
io_uring_queue_exit(&ring);
free(buf);
return 0;
Expand Down

0 comments on commit a0e3a45

Please sign in to comment.