diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index 9ff9f31f3d..af03c00641 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -139,7 +139,7 @@ spdk_nvmf_tgt_create_poll_group(void *io_device, void *ctx_buf) group->num_sgroups = tgt->opts.max_subsystems; group->sgroups = calloc(tgt->opts.max_subsystems, sizeof(struct spdk_nvmf_subsystem_poll_group)); if (!group->sgroups) { - return -1; + return -ENOMEM; } for (sid = 0; sid < tgt->opts.max_subsystems; sid++) { diff --git a/lib/thread/thread.c b/lib/thread/thread.c index c014f4ed02..3f0257689c 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -530,7 +530,7 @@ spdk_get_io_channel(void *io_device) pthread_mutex_unlock(&g_devlist_mutex); rc = dev->create_cb(io_device, (uint8_t *)ch + sizeof(*ch)); - if (rc == -1) { + if (rc != 0) { pthread_mutex_lock(&g_devlist_mutex); TAILQ_REMOVE(&ch->thread->io_channels, ch, tailq); dev->refcnt--;