]> git.baikalelectronics.ru Git - kernel.git/commit
mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning
authorNico Pache <npache@redhat.com>
Thu, 2 Sep 2021 21:58:08 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 16:58:15 +0000 (09:58 -0700)
commitd25572750309679925503c1ccb819ae128c2208a
tree60dc22cd16497fd6ee921f78d135d0ba93589fd4
parent1e54ac6f70daa6ba02569d4b51af914493a451c8
mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning

When compiling with -Werror, cc1 will warn that 'zone_id' may be used
uninitialized in this function warning.

Initialize the zone_id as 0.

Its safe to assume that if the code reaches this point it has at least one
numa node with memory, so no need for an assertion before
init_unavilable_range.

Link: https://lkml.kernel.org/r/20210716210336.1114114-1-npache@redhat.com
Fixes: 6d342d342f59 ("mm/page_alloc: fix memory map initialization for descending nodes")
Signed-off-by: Nico Pache <npache@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c