]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: fix dsm and copy commands free up buffers
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Thu, 11 Mar 2021 18:45:05 +0000 (00:15 +0530)
committerKeith Busch <kbusch@kernel.org>
Mon, 15 Mar 2021 21:28:17 +0000 (15:28 -0600)
In DSM and Copy Commands buffers which dyamically allocated
not freed, fixing that.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index e8e66d20fbdd79cfe87b7ce4474f19ccb172e65f..055bf4df76f6f52e5ccd2e22f84029e5908bb964 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4138,6 +4138,8 @@ static int dsm(int argc, char **argv, struct command *cmd, struct plugin *plugin
        else
                printf("NVMe DSM: success\n");
 
+       free(dsm);
+
 close_fd:
        close(fd);
 ret:
@@ -4272,6 +4274,8 @@ static int copy(int argc, char **argv, struct command *cmd, struct plugin *plugi
        else
                printf("NVMe Copy: success\n");
 
+       free(copy);
+
 close_fd:
        close(fd);
 ret: