Source
1174
1174
int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
1175
1175
phys_addr_t size, bool nomap)
1176
1176
{
1177
1177
if (nomap)
1178
1178
return memblock_remove(base, size);
1179
1179
return memblock_reserve(base, size);
1180
1180
}
1181
1181
1182
1182
static void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
1183
1183
{
1184
-
return memblock_alloc(size, align);
1184
+
void *ptr = memblock_alloc(size, align);
1185
+
1186
+
if (!ptr)
1187
+
panic("%s: Failed to allocate %llu bytes align=0x%llx\n",
1188
+
__func__, size, align);
1189
+
1190
+
return ptr;
1185
1191
}
1186
1192
1187
1193
bool __init early_init_dt_verify(void *params)
1188
1194
{
1189
1195
if (!params)
1190
1196
return false;
1191
1197
1192
1198
/* check device tree validity */
1193
1199
if (fdt_check_header(params))
1194
1200
return false;