From: Christian Brauner Date: Thu, 28 Oct 2021 15:39:11 +0000 (+0200) Subject: mainloop: make sure that descr->ring is allocated X-Git-Tag: lxc-5.0.0~60^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aac3f106ff012e1d6835b20c250dcf09c364530c;p=thirdparty%2Flxc.git mainloop: make sure that descr->ring is allocated This is future proofing more than anything else. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c index 7c8f5d86a..17a4d5529 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -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