Skip to content

Commit 4d3d6ac

Browse files
martin-gpyigaw
authored andcommitted
fabrics: fix uninitialized value in _nvmf_discovery()
Valgrind complained about a conditional jump or move depending on an uninitialized value created by a stack allocation at _nvmf_discovery(): ==16682== Conditional jump or move depends on uninitialised value(s) ==16682== at 0x4879DA5: _nvmf_discovery (fabrics.c:2198) ==16682== by 0x487B341: _discovery_config_json (fabrics.c:2424) ==16682== by 0x487B549: nvmf_discovery_config_json (fabrics.c:2461) ==16682== by 0x409A70: fabrics_discovery (fabrics.c:569) ==16682== by 0x446358: handle_plugin (plugin.c:190) ==16682== by 0x407760: main (nvme.c:11029) ==16682== Uninitialised value was created by a stack allocation ==16682== at 0x4879AF2: _nvmf_discovery (fabrics.c:2102) Fix the same. Signed-off-by: Martin George <[email protected]>
1 parent aa60cdb commit 4d3d6ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libnvme/src/nvme/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2134,7 +2134,7 @@ static int _nvmf_discovery(struct nvme_global_ctx *ctx,
21342134
nvme_ctrl_t cl;
21352135
bool discover = false;
21362136
bool disconnect;
2137-
nvme_ctrl_t child;
2137+
nvme_ctrl_t child = { 0 };
21382138
int tmo = fctx->cfg->keep_alive_tmo;
21392139

21402140
struct fabric_args trcfg = {

0 commit comments

Comments
 (0)