]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: fix uninitialized value in error-log
authorMartin George <marting@netapp.com>
Sun, 22 Sep 2024 18:21:20 +0000 (23:51 +0530)
committerDaniel Wagner <wagi@monom.org>
Mon, 23 Sep 2024 09:28:26 +0000 (11:28 +0200)
Valgrind complained about an "uninitialized value created by a
stack allocation" error while running the error-log command.
Fix the same.

Signed-off-by: Martin George <marting@netapp.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 02c89db5f0af2366decb1ec4e406398312b64ba3..a1e65fb34045c92b4b263440be1d2a1a0fef3730 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1169,7 +1169,7 @@ static int get_error_log(int argc, char **argv, struct command *cmd, struct plug
 
        _cleanup_free_ struct nvme_error_log_page *err_log = NULL;
        _cleanup_nvme_dev_ struct nvme_dev *dev = NULL;
-       struct nvme_id_ctrl ctrl;
+       struct nvme_id_ctrl ctrl = { 0 };
        nvme_print_flags_t flags;
        int err = -1;