Commit b22bccf4 authored by Nico Pache's avatar Nico Pache Committed by Zheng Zengkai
Browse files

mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning

mainline inclusion
from mainline-v5.15-rc1
commit b346075f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4S7MA
CVE: NA

--------------------------------

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: 122e093c ("mm/page_alloc: fix memory map initialization for descending nodes")
Signed-off-by: default avatarNico Pache <npache@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 03d0f7b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment