]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvme/flush: explicitely close file descriptor
authorKeith Busch <keith.busch@intel.com>
Mon, 20 Nov 2017 20:18:51 +0000 (13:18 -0700)
committerKeith Busch <keith.busch@intel.com>
Mon, 20 Nov 2017 20:18:51 +0000 (13:18 -0700)
Was alread closed implicitly immediately after this function returns,
but there's no reason to leave it open either.

Reported-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index cedf96c19fbdcab86790346b9b79a6de7ddecac5..5c298dd7dd25b75656750b0eb9dae53c866742d5 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2375,6 +2375,7 @@ static int flush(int argc, char **argv, struct command *cmd, struct plugin *plug
                                nvme_status_to_string(err), err);
        else
                printf("NVMe Flush: success\n");
+       close(fd);
        return err;
 }