diff options
author | Karel Zak | 2017-10-12 12:44:55 +0200 |
---|---|---|
committer | Karel Zak | 2017-10-12 12:44:55 +0200 |
commit | 5794087292d97bb7dd28ae58bcf862c454bd5dcc (patch) | |
tree | a74cbc4b6921d439072c04dbe7549a9b1c788480 /misc-utils/fincore.c | |
parent | libsmartcols: (sample) cleanup line separator usage (diff) | |
download | kernel-qcow2-util-linux-5794087292d97bb7dd28ae58bcf862c454bd5dcc.tar.gz kernel-qcow2-util-linux-5794087292d97bb7dd28ae58bcf862c454bd5dcc.tar.xz kernel-qcow2-util-linux-5794087292d97bb7dd28ae58bcf862c454bd5dcc.zip |
fincore: make sure mmap(NULL, ...) [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/fincore.c')
-rw-r--r-- | misc-utils/fincore.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c index f1596a736..4641408f8 100644 --- a/misc-utils/fincore.c +++ b/misc-utils/fincore.c @@ -194,13 +194,13 @@ static int fincore_fd (struct fincore_control *ctl, off_t *count_incore) { size_t window_size = N_PAGES_IN_WINDOW * ctl->pagesize; - off_t file_offset; - void *window = NULL; + off_t file_offset; int rc = 0; int warned_once = 0; for (file_offset = 0; file_offset < file_size; file_offset += window_size) { size_t len; + void *window = NULL; len = file_size - file_offset; if (len >= window_size) |