Re: [PATCH] selftest/vm: uninitialized variable in main()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 19, 2022 at 2:04 AM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> Initialize "length" to zero by default.
>
> Fixes: ff712a627f72 ("selftests/vm: cleanup hugetlb file after mremap test")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Thanks,

Reviewed-by: Mina Almasry <almasrymina@xxxxxxxxxx>

> ---
>  tools/testing/selftests/vm/hugepage-mremap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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]);
> --
> 2.35.1
>



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux