diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index 632513e6b..8c70bafc7 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -57,7 +57,7 @@ struct feature { bool valid; }; -static struct feature features[256]; +static struct feature features[256] = {}; static struct spdk_nvme_error_information_entry error_page[256]; @@ -180,11 +180,14 @@ static int get_feature(struct spdk_nvme_ctrlr *ctrlr, uint8_t fid) { struct spdk_nvme_cmd cmd = {}; + struct feature *feature = &features[fid]; + + feature->valid = false; cmd.opc = SPDK_NVME_OPC_GET_FEATURES; cmd.cdw10 = fid; - return spdk_nvme_ctrlr_cmd_admin_raw(ctrlr, &cmd, NULL, 0, get_feature_completion, &features[fid]); + return spdk_nvme_ctrlr_cmd_admin_raw(ctrlr, &cmd, NULL, 0, get_feature_completion, feature); } static void