Commit bc8755ba authored by Wei Yang's avatar Wei Yang Committed by Linus Torvalds
Browse files

mm: check __highest_present_section_nr directly in memory_dev_init()

__highest_present_section_nr is a more strict boundary than
NR_MEM_SECTIONS.  So checking __highest_present_section_nr directly is


Signed-off-by: default avatarWei Yang <>
Reviewed-by: default avatarAndrew Morton <>
Cc: Dave Hansen <>
Cc: Michal Hocko <>
Cc: David Rientjes <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 09a913a7
......@@ -837,11 +837,8 @@ int __init memory_dev_init(void)
* during boot and have been initialized
for (i = 0; i < NR_MEM_SECTIONS; i += sections_per_block) {
/* Don't iterate over sections we know are !present: */
if (i > __highest_present_section_nr)
for (i = 0; i <= __highest_present_section_nr;
i += sections_per_block) {
err = add_memory_block(i);
if (!ret)
ret = err;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment