]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
ocp: fix to set log data pointer allocated
authorTokunori Ikegami <ikegami.t@gmail.com>
Wed, 18 Sep 2024 14:36:08 +0000 (23:36 +0900)
committerDaniel Wagner <wagi@monom.org>
Thu, 19 Sep 2024 06:57:32 +0000 (08:57 +0200)
Previously the NULL pointer is set incorrectly.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
plugins/ocp/ocp-hardware-component-log.c

index 8d638c97ce0c8ebbf6426711319efb893a66b783..679aae89f9b5759311653efe73265758865c9096 100644 (file)
@@ -339,7 +339,6 @@ static int get_hwcomp_log_data(struct nvme_dev *dev, struct hwcomp_log *log)
        size_t desc_offset = offsetof(struct hwcomp_log, desc);
        struct nvme_get_log_args args = {
                .lpo = desc_offset,
-               .log = log->desc,
                .args_size = sizeof(args),
                .fd = dev_fd(dev),
                .timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
@@ -370,6 +369,8 @@ static int get_hwcomp_log_data(struct nvme_dev *dev, struct hwcomp_log *log)
                return -1;
        }
 
+       args.log = log->desc,
+
 #ifdef HWCOMP_DUMMY
        memcpy(log->desc, &hwcomp_dummy[desc_offset], args.len);
 #else /* HWCOMP_DUMMY */