[merged] mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [merged] mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch removed from -mm tree
To: phacht@xxxxxxxxxxxxxxxxxx,hannes@xxxxxxxxxxx,iamjoonsoo.kim@xxxxxxx,tangchen@xxxxxxxxxxxxxx,tj@xxxxxxxxxx,toshi.kani@xxxxxx,mm-commits@xxxxxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Fri, 24 Jan 2014 10:58:57 -0800


The patch titled
     Subject: mm/nobootmem.c: add return value check in __alloc_memory_core_early()
has been removed from the -mm tree.  Its filename was
     mm-nobootmemc-add-return-value-check-in-__alloc_memory_core_early.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
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

origin.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




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux