[Skiboot] [PATCH 4/4] assert that allocation of node region name succeeeds

Stewart Smith stewart at linux.vnet.ibm.com
Wed Sep 9 15:54:13 AEST 2015


Just bailing out this early in boot is perfectly acceptable.

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 core/mem_region.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/mem_region.c b/core/mem_region.c
index f6a52a0..17fe268 100644
--- a/core/mem_region.c
+++ b/core/mem_region.c
@@ -945,6 +945,7 @@ void mem_region_init(void)
 		if (!dt_has_node_property(i, "device_type", "memory"))
 			continue;
 		rname = zalloc(strlen(i->name) + strlen(NODE_REGION_PREFIX) + 1);
+		assert(rname);
 		strcat(rname, NODE_REGION_PREFIX);
 		strcat(rname, i->name);
 		start = dt_get_address(i, 0, &len);
-- 
2.1.4



More information about the Skiboot mailing list