From: Karel Zak Date: Thu, 12 Oct 2017 10:44:55 +0000 (+0200) Subject: fincore: make sure mmap(NULL, ...) [coverity scan] X-Git-Tag: v2.31~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5794087292d97bb7dd28ae58bcf862c454bd5dcc;p=thirdparty%2Futil-linux.git fincore: make sure mmap(NULL, ...) [coverity scan] Signed-off-by: Karel Zak --- 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)