]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning
authorNico Pache <npache@redhat.com>
Mon, 23 Aug 2021 23:59:27 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:06 +0000 (09:34 +1000)
commit923ddb55aaf6e89b4445a81225e7cb1ee983d6ec
tree728bf7e113c2a1560559a48d57eebd2e0d571b28
parent17931e564ba984880713460ab1dcc79233e6c17f
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: 122e093c1734 ("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: Stephen Rothwell <sfr@canb.auug.org.au>
mm/page_alloc.c