core/mem_region: check return value of add_region
The only sensible thing to do if this fails is to abort() as we've
likely just failed reserving reserved memory regions, and nothing
good comes from that.
Found by static analysis
-/* Copyright 2013-2014 IBM Corp.
+/* Copyright 2013-2017 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -947,7 +947,10 @@ static void mem_region_parse_reserved_properties(void)
dt_get_number(range, 2),
dt_get_number(range + 1, 2),
NULL, REGION_FW_RESERVED);
- add_region(region);
+ if (!add_region(region)) {
+ prerror("Couldn't add mem_region %s\n", name);
+ abort();
+ }
}
} else if (names || ranges) {
prerror("Invalid properties: reserved-names=%p "
