Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1718561
| From | Pavel Tatashin <pasha.tatashin@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 1/1] mm: Reversed logic in memblock_discard |
| Date | 2017-08-23 20:10 +0200 |
| Message-ID | <uhIgi-3UK-21@gated-at.bofh.it> (permalink) |
| References | <uhIgh-3UK-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
In recently introduced memblock_discard() there is a reversed logic bug.
Memory is freed of static array instead of dynamically allocated one.
Fixes: 3010f876500f ("mm: discard memblock data later")
Reported-and-tested-by: Woody Suwalski <terraluna977@gmail.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
---
mm/memblock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.14.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 0/1] Reversed logic in memblock_discard Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-23 20:10 +0200
[PATCH v1 1/1] mm: Reversed logic in memblock_discard Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-23 20:10 +0200
Re: [PATCH v1 1/1] mm: Reversed logic in memblock_discard Vlastimil Babka <vbabka@suse.cz> - 2017-08-24 14:30 +0200
csiph-web