aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 5c3503c98b2f..5096500b2647 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -932,16 +932,14 @@ int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
* covered by the memory map. The struct page representing NOMAP memory
* frames in the memory map will be PageReserved()
*
+ * Note: if the memory being marked %MEMBLOCK_NOMAP was allocated from
+ * memblock, the caller must inform kmemleak to ignore that memory
+ *
* Return: 0 on success, -errno on failure.
*/
int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size)
{
- int ret = memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
-
- if (!ret)
- kmemleak_free_part_phys(base, size);
-
- return ret;
+ return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
}
/**
@@ -1692,7 +1690,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
if (!size)
return;
- if (memblock.memory.cnt <= 1) {
+ if (!memblock_memory->total_size) {
pr_warn("%s: No memory registered yet\n", __func__);
return;
}