bdev/nvme: Consolidate exit paths of connect_attach_cb()

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ife0bc6575697dee5a470793361502a852b132191
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5651
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2020-12-19 02:41:30 +09:00 committed by Tomasz Zawadzki
parent b2d785ee48
commit 5f523c44f0

View File

@ -1923,22 +1923,23 @@ connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
rc = bdev_nvme_add_trid(nvme_bdev_ctrlr, ctrlr, &ctx->trid);
spdk_nvme_detach(ctrlr);
populate_namespaces_cb(ctx, 0, rc);
return;
goto exit;
}
rc = nvme_bdev_ctrlr_create(ctrlr, ctx->base_name, &ctx->trid, ctx->prchk_flags);
if (rc) {
SPDK_ERRLOG("Failed to create new device\n");
populate_namespaces_cb(ctx, 0, rc);
return;
goto exit;
}
nvme_bdev_ctrlr = nvme_bdev_ctrlr_get(&ctx->trid);
assert(nvme_bdev_ctrlr != NULL);
nvme_ctrlr_populate_namespaces(nvme_bdev_ctrlr, ctx);
return;
exit:
populate_namespaces_cb(ctx, 0, rc);
}
static int