Skip to content

Commit 85154a1

Browse files
jeff-lien-sndkigaw
authored andcommitted
ocp: Fix core dump during telemetry log decode
When decoding ocp 2.5 telemetry log with json output the internal-log ocp plugin command was hitting an issue that caused a core dump. This commit will resolve that error. Signed-off-by: jeff-lien-sndk <[email protected]>
1 parent 15c1805 commit 85154a1

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/ocp/ocp-nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if !defined(OCP_NVME) || defined(CMD_HEADER_MULTI_READ)
1212
#define OCP_NVME
1313

14-
#define OCP_PLUGIN_VERSION "2.16.0"
14+
#define OCP_PLUGIN_VERSION "3.0.0"
1515
#include "cmd.h"
1616

1717
PLUGIN(NAME("ocp", "OCP cloud SSD extensions", OCP_PLUGIN_VERSION),

plugins/ocp/ocp-telemetry-decode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,9 @@ int parse_event_fifo(unsigned int fifo_num, unsigned char *pfifo_start,
12251225
(le16_to_cpu((unsigned int)pStaticSnapshotEvent->stat_data_size) *
12261226
SIZE_OF_DWORD);
12271227

1228+
struct json_object *pstats_array =
1229+
((pevent_fifos_object != NULL) ? json_create_array() : NULL);
1230+
12281231
if (pStaticSnapshotEvent != NULL &&
12291232
pStaticSnapshotEvent->stat_data_size > 0) {
12301233
__u8 *pstatistic_entry =
@@ -1234,7 +1237,7 @@ int parse_event_fifo(unsigned int fifo_num, unsigned char *pfifo_start,
12341237
parse_statistic(
12351238
(struct nvme_ocp_telemetry_statistic_descriptor *)
12361239
pstatistic_entry,
1237-
pevent_descriptor_obj,
1240+
pstats_array,
12381241
fp);
12391242
}
12401243
} else {

0 commit comments

Comments
 (0)