From 5794087292d97bb7dd28ae58bcf862c454bd5dcc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 12 Oct 2017 12:44:55 +0200 Subject: [PATCH] fincore: make sure mmap(NULL, ...) [coverity scan] Signed-off-by: Karel Zak --- misc-utils/fincore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c index f1596a7366..4641408f89 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) -- 2.47.2