]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
netapp: fix uninitialized value from heap error
authorMartin George <marting@netapp.com>
Fri, 16 Aug 2024 11:42:44 +0000 (17:12 +0530)
committerDaniel Wagner <wagi@monom.org>
Mon, 19 Aug 2024 08:56:59 +0000 (10:56 +0200)
Valgrind complained about an "uninitialized value created by a
heap allocation" error. Fix the same.

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

index 99f0a20df4a6a1cbac99aed92232d7de81faaf10..fb1b5679acaef48b0f822cbde9925c863c3c7777 100644 (file)
@@ -470,6 +470,8 @@ static int netapp_ontapdevices_get_info(int fd, struct ontapdevice_info *item,
                return 0;
        }
 
+       memset(nsdescs, 0, 0x1000);
+
        err = nvme_identify_ns_descs(fd, item->nsid, nsdescs);
        if (err) {
                fprintf(stderr, "Unable to identify namespace descriptor for %s (%s)\n",