]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: pagewalk: add back missing variable initializations
authorRolf Eike Beer <eb@emlix.com>
Wed, 24 Aug 2022 11:00:11 +0000 (13:00 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:03:24 +0000 (22:03 -0700)
These initializations accidentially got lost during refactoring.

The first one can't actually be used without initialization, because
walk_p4d_range() is only called when one of the 4 callbacks is set, but relying
on this seems fragile.

Link: https://lkml.kernel.org/r/2123960.ggj6I0NvhH@mobilepool36.emlix.com
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/pagewalk.c

index 4d5ce5bce1903eddd61833eb4a8091d8df3d518d..818e00384d397d6050f8cc42c69cc2d2e0e42b79 100644 (file)
@@ -225,7 +225,7 @@ static int walk_p4d_range(pgd_t *pgd, unsigned long addr, unsigned long end,
 
        p4d = p4d_offset(pgd, addr);
        do {
-               int err;
+               int err = 0;
 
                next = p4d_addr_end(addr, end);
                if (p4d_none_or_clear_bad(p4d)) {