diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-07-19 12:04:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-17 16:15:40 +0300 |
commit | c6bc611f371d5a7800dfe21a609dd184f333d237 (patch) | |
tree | 33416363b49d2ccb71e9e2975a09fe308953aedf /tools | |
parent | 8d958b6356320788549ff2bdaebc2fd89cd76217 (diff) | |
download | linux-c6bc611f371d5a7800dfe21a609dd184f333d237.tar.xz |
selftest/vm: uninitialized variable in main()
[ Upstream commit 360b420dbded8ad5b70a41de98e77354dd9e7d36 ]
Initialize "length" to zero by default.
Link: https://lkml.kernel.org/r/YtZzjvHXVXMXxpXO@kili
Fixes: ff712a627f72 ("selftests/vm: cleanup hugetlb file after mremap test")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/vm/hugepage-mremap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/hugepage-mremap.c b/tools/testing/selftests/vm/hugepage-mremap.c index 585978f181ed..e63a0214f639 100644 --- a/tools/testing/selftests/vm/hugepage-mremap.c +++ b/tools/testing/selftests/vm/hugepage-mremap.c @@ -107,7 +107,7 @@ static void register_region_with_uffd(char *addr, size_t len) int main(int argc, char *argv[]) { - size_t length; + size_t length = 0; if (argc != 2 && argc != 3) { printf("Usage: %s [length_in_MB] <hugetlb_file>\n", argv[0]); |