From 525cf1e6edbc7eeba27e7fcbbdf90d5cf113f57b Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Wed, 18 Sep 2024 23:36:08 +0900 Subject: [PATCH] ocp: fix to set log data pointer allocated Previously the NULL pointer is set incorrectly. Signed-off-by: Tokunori Ikegami --- plugins/ocp/ocp-hardware-component-log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ocp/ocp-hardware-component-log.c b/plugins/ocp/ocp-hardware-component-log.c index 8d638c97..679aae89 100644 --- a/plugins/ocp/ocp-hardware-component-log.c +++ b/plugins/ocp/ocp-hardware-component-log.c @@ -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 */ -- 2.50.1