io_channel: allow NULL spdk_for_each_channel cpl_fn

Some callers may not require a callback function once
the specified function has been called on all channels.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I925751d221918810c2e966640ca636482bf6f866

Reviewed-on: https://review.gerrithub.io/377859
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2017-09-09 20:50:26 -07:00
parent 70a0bc3096
commit e0252fe128

View File

@ -415,7 +415,9 @@ _call_completion(void *ctx)
{
struct call_channel *ch_ctx = ctx;
ch_ctx->cpl(ch_ctx->io_device, ch_ctx->ctx);
if (ch_ctx->cpl != NULL) {
ch_ctx->cpl(ch_ctx->io_device, ch_ctx->ctx);
}
free(ch_ctx);
}