lib: return error in case of start_fn is null in spdk_app_start()

instead of hitting S11 on event

Change-Id: I7af2a1961bf2c05005a23c3f50eadbcd23e7e38f
Signed-off-by: Leonid Ravich <Leonid.Ravich@dell.com>
Reviewed-on: https://review.gerrithub.io/416972
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Leonid Ravich 2018-06-27 14:09:50 +03:00 committed by Daniel Verkamp
parent 322e50468c
commit 2a92c30292

View File

@ -484,6 +484,11 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn,
return 1;
}
if (!start_fn) {
SPDK_ERRLOG("start_fn should not be NULL\n");
return 1;
}
if (opts->print_level > SPDK_LOG_WARN &&
isatty(STDERR_FILENO) &&
!strncmp(ttyname(STDERR_FILENO), "/dev/tty", strlen("/dev/tty"))) {