From 4a1ec34d3ba3f1a982af39b104e9cb32bb6f78f5 Mon Sep 17 00:00:00 2001 From: yidong0635 Date: Tue, 17 Mar 2020 04:00:11 -0400 Subject: [PATCH] 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 Change-Id: I4b0ae106ef8e4e72e80ec96d10010fddf8173144 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1314 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto --- lib/nvme/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvme/nvme.c b/lib/nvme/nvme.c index 214c306cec..141df48196 100644 --- a/lib/nvme/nvme.c +++ b/lib/nvme/nvme.c @@ -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) {