From 01c4d3d32c5044d3d17055c2d94d40fee9d130e1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 1 Jul 2023 00:38:48 +0200 Subject: Adding upstream version 2.5. Signed-off-by: Daniel Baumann --- plugins/solidigm/solidigm-telemetry.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/solidigm/solidigm-telemetry.c') diff --git a/plugins/solidigm/solidigm-telemetry.c b/plugins/solidigm/solidigm-telemetry.c index 9946991..472284a 100644 --- a/plugins/solidigm/solidigm-telemetry.c +++ b/plugins/solidigm/solidigm-telemetry.c @@ -112,7 +112,7 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc } if (cfg.cfg_file) { - char *conf_str = 0; + char *conf_str = NULL; size_t length = 0; err = read_file2buffer(cfg.cfg_file, &conf_str, &length); @@ -121,9 +121,10 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc cfg.cfg_file, strerror(err)); goto close_fd; } - struct json_tokener * jstok = json_tokener_new(); + struct json_tokener *jstok = json_tokener_new(); tl.configuration = json_tokener_parse_ex(jstok, conf_str, length); + free(conf_str); if (jstok->err != json_tokener_success) { SOLIDIGM_LOG_WARNING("Parsing error on JSON configuration file %s: %s (at offset %d)", cfg.cfg_file, @@ -160,11 +161,7 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc goto close_fd; } } - solidigm_telemetry_log_header_parse(&tl); - if (cfg.cfg_file) - solidigm_telemetry_log_data_areas_parse(&tl, cfg.data_area); - else - solidigm_telemetry_log_cod_parse(&tl); + solidigm_telemetry_log_data_areas_parse(&tl, cfg.data_area); json_print_object(tl.root, NULL); json_free_object(tl.root); -- cgit v1.2.3