summaryrefslogtreecommitdiffstats
path: root/plugins/toshiba
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:11:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:18:07 +0000
commit2e650c1f5f2f79e7db10dec5dcdd1cffcaf47891 (patch)
tree82f2949088d2502e947b83ba9973de54f9bf4402 /plugins/toshiba
parentReleasing debian version 2.0-1. (diff)
downloadnvme-cli-2e650c1f5f2f79e7db10dec5dcdd1cffcaf47891.tar.xz
nvme-cli-2e650c1f5f2f79e7db10dec5dcdd1cffcaf47891.zip
Merging upstream version 2.1~rc0 (Closes: #1015722).
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