aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Tatashin <[email protected]>2017-08-25 15:55:46 -0700
committerLinus Torvalds <[email protected]>2017-08-25 16:12:46 -0700
commit91b540f98872a206ea1c49e4aa6ea8eed0886644 (patch)
treef9364d7d1c9c47123ca73d1910b76322482da9a4
parent2b7e8665b4ff51c034c55df3cff76518d1a9ee3a (diff)
mm/memblock.c: reversed logic in memblock_discard()
In recently introduced memblock_discard() there is a reversed logic bug. Memory is freed of static array instead of dynamically allocated one. Link: http://lkml.kernel.org/r/[email protected] Fixes: 3010f876500f ("mm: discard memblock data later") Signed-off-by: Pavel Tatashin <[email protected]> Reported-by: Woody Suwalski <[email protected]> Tested-by: Woody Suwalski <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memblock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index bf14aea6ab70..91205780e6b1 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -299,7 +299,7 @@ void __init memblock_discard(void)
__memblock_free_late(addr, size);
}
- if (memblock.memory.regions == memblock_memory_init_regions) {
+ if (memblock.memory.regions != memblock_memory_init_regions) {
addr = __pa(memblock.memory.regions);
size = PAGE_ALIGN(sizeof(struct memblock_region) *
memblock.memory.max);