From 25d5bf65709b0b110d59fb1e594a2cc8b4387c55 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Fri, 1 Mar 2024 17:31:27 +0100 Subject: [PATCH] osmo_io: do check_mode_callback_compat() only if ioops is set at osmo_iofd_setup() Setting ioops is optional when calling osmo_iofd_setup(). If it is not set, do not call check_mode_callback_compat() to check for compatibility. Closes: Coverity CID#349578 Change-Id: I1e25f3e420f25a44cbf73a4da9a498b7561e9ddd --- src/core/osmo_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 33466e5d1..5a5e05c76 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -619,7 +619,7 @@ struct osmo_io_fd *osmo_iofd_setup(const void *ctx, int fd, const char *name, en return NULL; } - if (!check_mode_callback_compat(mode, ioops)) + if (ioops && !check_mode_callback_compat(mode, ioops)) return NULL; iofd = talloc_zero(ctx, struct osmo_io_fd);