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
This commit is contained in:
Andreas Eversberg 2024-03-01 17:31:27 +01:00 committed by laforge
parent 4f155022d8
commit 25d5bf6570
1 changed files with 1 additions and 1 deletions

View File

@ -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);