summaryrefslogtreecommitdiffstats
path: root/plugins/toshiba
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:11:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:11:33 +0000
commita751023422eadf87cd8d6484878193a4914a9d85 (patch)
tree3fca0ae6325173fc2583e7d88abe4c38e6193277 /plugins/toshiba
parentAdding upstream version 2.0. (diff)
downloadnvme-cli-a751023422eadf87cd8d6484878193a4914a9d85.tar.xz
nvme-cli-a751023422eadf87cd8d6484878193a4914a9d85.zip
Adding upstream version 2.1~rc0.upstream/2.1_rc0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/toshiba')
-rw-r--r--plugins/toshiba/toshiba-nvme.c5
-rw-r--r--plugins/toshiba/toshiba-nvme.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/plugins/toshiba/toshiba-nvme.c b/plugins/toshiba/toshiba-nvme.c
index fd2e9c1..cf19352 100644
--- a/plugins/toshiba/toshiba-nvme.c
+++ b/plugins/toshiba/toshiba-nvme.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
@@ -148,6 +149,7 @@ static int nvme_sct_command_transfer_log(int fd, bool current)
memcpy(data + 2, &function_code, sizeof(function_code));
err = nvme_sct_op(fd, OP_SCT_COMMAND_TRANSFER, DW10_SCT_COMMAND_TRANSFER, DW11_SCT_COMMAND_TRANSFER, data, data_len);
+ free(data);
return err;
}
@@ -474,6 +476,7 @@ static int vendor_log(int argc, char **argv, struct command *cmd, struct plugin
end:
if (err > 0)
nvme_show_status(err);
+ close(fd);
return err;
}
@@ -517,6 +520,7 @@ static int internal_log(int argc, char **argv, struct command *cmd, struct plugi
if (err > 0)
nvme_show_status(err);
+ close(fd);
return err;
}
@@ -569,5 +573,6 @@ static int clear_correctable_errors(int argc, char **argv, struct command *cmd,
end:
if (err > 0)
nvme_show_status(err);
+ close(fd);
return err;
}
diff --git a/plugins/toshiba/toshiba-nvme.h b/plugins/toshiba/toshiba-nvme.h
index ebd7575..6208f5d 100644
--- a/plugins/toshiba/toshiba-nvme.h
+++ b/plugins/toshiba/toshiba-nvme.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
#undef CMD_INC_FILE
#define CMD_INC_FILE plugins/toshiba/toshiba-nvme