Commit d8343f94 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

module/bdev_nvme: Fix some unreachable code.



All of the error cases for spdk_nvme_transport_id_parse_trtype
were covered earlier, so just make this an assert.

fix kw warning 12653.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: If0eea934764b35d097887b98b0441ae5d7dd3e4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1953


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 9f50e7c2
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -282,12 +282,7 @@ spdk_rpc_bdev_nvme_attach_controller(struct spdk_jsonrpc_request *request,

	/* Parse trtype */
	rc = spdk_nvme_transport_id_parse_trtype(&trid.trtype, ctx->req.trtype);
	if (rc < 0) {
		SPDK_ERRLOG("Failed to parse trtype: %s\n", ctx->req.trtype);
		spdk_jsonrpc_send_error_response_fmt(request, -EINVAL, "Failed to parse trtype: %s",
						     ctx->req.trtype);
		goto cleanup;
	}
	assert(rc == 0);

	/* Parse traddr */
	snprintf(trid.traddr, sizeof(trid.traddr), "%s", ctx->req.traddr);