lib/nvme: Fix scanbuild issue about uninitialized value.

Issue:
nvme.c:766:2: warning: 4th function call argument is an uninitialized value
        snprintf(trid->trstring, SPDK_NVMF_TRSTRING_MAX_LEN, "%s", trstring);

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I4b0ae106ef8e4e72e80ec96d10010fddf8173144
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1314
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
yidong0635 2020-03-17 04:00:11 -04:00 committed by Tomasz Zawadzki
parent 7098c65339
commit 4a1ec34d3b

View File

@ -742,7 +742,7 @@ void
spdk_nvme_trid_populate_transport(struct spdk_nvme_transport_id *trid,
enum spdk_nvme_transport_type trtype)
{
const char *trstring;
const char *trstring = "";
trid->trtype = trtype;
switch (trtype) {