summaryrefslogtreecommitdiff
path: root/util/nvramtool/cbfs.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2014-08-03 12:10:53 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2014-08-03 15:19:27 +0200
commitedb0a61be4030cc6bdc605332204bb27c9f1b98f (patch)
tree076616c152ba9dae2c0a9794b8c81996b2bbe9d8 /util/nvramtool/cbfs.c
parent5fc04d1fdd2d4c763ba39c3d90e487e9f773b122 (diff)
nvramtool: Close file after use
mmap builds a new reference to the file, so the file descriptor isn't necessary anymore. Close it. Change-Id: I639fd13ff8f13cbdfce1d199d75744e56f2b19b3 Found-by: Coverity Scan Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/6475 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util/nvramtool/cbfs.c')
-rw-r--r--util/nvramtool/cbfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/nvramtool/cbfs.c b/util/nvramtool/cbfs.c
index febe0bed07..abd40eec12 100644
--- a/util/nvramtool/cbfs.c
+++ b/util/nvramtool/cbfs.c
@@ -144,6 +144,7 @@ void open_cbfs(const char *filename)
}
cbfs_mapped = mmap(NULL, cbfs_stat.st_size, PROT_READ | PROT_WRITE,
MAP_SHARED, cbfs_fd, 0);
+ close(cbfs_fd);
if (cbfs_mapped == MAP_FAILED) {
printf("Couldn't map '%s'\n", filename);
exit(-1);