From 2371a4f26edcad6aa3fb1d734cbcd5b345fa052d Mon Sep 17 00:00:00 2001 From: Tetsuya TAKAHASHI Date: Fri, 27 Sep 2024 10:50:54 +0900 Subject: [PATCH] ocp: fix option handling in internal-log When the noraml format is specified without -t option to ocp internal-log command, the command ends abnormally with segmentation fault. This commit fixes the option handling. Signed-off-by: Tetsuya TAKAHASHI --- plugins/ocp/ocp-nvme.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ocp/ocp-nvme.c b/plugins/ocp/ocp-nvme.c index 8ebeb54d..22bba365 100644 --- a/plugins/ocp/ocp-nvme.c +++ b/plugins/ocp/ocp-nvme.c @@ -1775,6 +1775,9 @@ static int ocp_telemetry_log(int argc, char **argv, struct command *cmd, if (err) return err; + if (opt.telemetry_type == 0) + opt.telemetry_type = "host"; + err = fstat(dev_fd(dev), &nvme_stat); if (err < 0) return err; -- 2.50.1