Subject: + mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch added to -mm tree To: phacht@xxxxxxxxxxxxxxxxxx,hannes@xxxxxxxxxxx,iamjoonsoo.kim@xxxxxxx,tangchen@xxxxxxxxxxxxxx,tj@xxxxxxxxxx,toshi.kani@xxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 07 Jan 2014 13:40:06 -0800 The patch titled Subject: mm/nobootmem.c: add return value check in __alloc_memory_core_early() has been added to the -mm tree. Its filename is mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Philipp Hachtmann <phacht@xxxxxxxxxxxxxxxxxx> Subject: mm/nobootmem.c: add return value check in __alloc_memory_core_early() When memblock_reserve() fails because memblock.reserved.regions cannot be resized, the caller (e.g. alloc_bootmem()) is not informed of the failed allocation. Therefore alloc_bootmem() silently returns the same pointer again and again. This patch adds a check for the return value of memblock_reserve() in __alloc_memory_core(). Signed-off-by: Philipp Hachtmann <phacht@xxxxxxxxxxxxxxxxxx> Reviewed-by: Tejun Heo <tj@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Tang Chen <tangchen@xxxxxxxxxxxxxx> Cc: Toshi Kani <toshi.kani@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/nobootmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN mm/nobootmem.c~mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early mm/nobootmem.c --- a/mm/nobootmem.c~mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early +++ a/mm/nobootmem.c @@ -45,7 +45,9 @@ static void * __init __alloc_memory_core if (!addr) return NULL; - memblock_reserve(addr, size); + if (memblock_reserve(addr, size)) + return NULL; + ptr = phys_to_virt(addr); memset(ptr, 0, size); /* _ Patches currently in -mm which might be from phacht@xxxxxxxxxxxxxxxxxx are mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html