summaryrefslogtreecommitdiffstats
path: root/plugins/ocp/ocp-nvme.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ocp/ocp-nvme.c')
-rw-r--r--plugins/ocp/ocp-nvme.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/plugins/ocp/ocp-nvme.c b/plugins/ocp/ocp-nvme.c
index 6b7fc9d..56cfdff 100644
--- a/plugins/ocp/ocp-nvme.c
+++ b/plugins/ocp/ocp-nvme.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-License-Identifier: GPL-2.0-or-later
/* Copyright (c) 2022 Meta Platforms, Inc.
*
* Authors: Arthur Shau <arthurshau@fb.com>,
@@ -380,11 +380,6 @@ static int get_c0_log_page(int fd, char *format)
}
/* print the data */
- if (!data) {
- fprintf(stderr, "ERROR : OCP : Invalid buffer to read 0xC0 log\n");
- ret = -1;
- goto out;
- }
switch (fmt) {
case NORMAL:
ocp_print_C0_log_normal(data);
@@ -430,7 +425,7 @@ static int ocp_smart_add_log(int argc, char **argv, struct command *cmd,
if (ret)
fprintf(stderr, "ERROR : OCP : Failure reading the C0 Log Page, ret = %d\n",
ret);
-
+ close(fd);
return ret;
}
@@ -728,13 +723,6 @@ static int get_c3_log_page(int fd, char *format)
}
}
- /* print the data */
- if (!log_data) {
- fprintf(stderr,
- "ERROR : OCP : Invalid C3 log data buffer\n");
- ret = -1;
- goto out;
- }
switch (fmt) {
case NORMAL:
ocp_print_C3_log_normal(fd, log_data);
@@ -783,6 +771,6 @@ static int ocp_latency_monitor_log(int argc, char **argv, struct command *comman
fprintf(stderr,
"ERROR : OCP : Failure reading the C3 Log Page, ret = %d\n",
ret);
-
+ close(fd);
return ret;
}