Skip to content

Commit

Permalink
mainloop: make sure that descr->ring is allocated
Browse files Browse the repository at this point in the history
This is future proofing more than anything else.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Oct 29, 2021
1 parent 1a88958 commit f69e6b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lxc/mainloop.c
Expand Up @@ -515,8 +515,10 @@ void lxc_mainloop_close(struct lxc_async_descr *descr)

if (descr->type == LXC_MAINLOOP_IO_URING) {
#if HAVE_LIBURING
io_uring_queue_exit(descr->ring);
munmap(descr->ring, sizeof(struct io_uring));
if (descr->ring) {
io_uring_queue_exit(descr->ring);
munmap(descr->ring, sizeof(struct io_uring));
}
#else
ERROR("Unsupported io_uring mainloop");
#endif
Expand Down

0 comments on commit f69e6b4

Please sign in to comment.