core: ignore boot modules with size 0
A boot module with size 0 previously made Core crash with a page fault in Region_map_component::attach. This patch prevents the creation of ROM-FS entries for such modules. Ref #2490
This commit is contained in:
parent
23f35370a2
commit
27a608a20a
|
@ -24,9 +24,14 @@ void Platform::_init_rom_modules()
|
|||
Boot_modules_header *header = &_boot_modules_headers_begin;
|
||||
for (; header < &_boot_modules_headers_end; header++) {
|
||||
|
||||
if (!header->size) {
|
||||
warning("ignore zero-sized boot module '",
|
||||
Cstring((char const *)header->name), "'");
|
||||
continue;
|
||||
}
|
||||
Rom_module *rom_module = new (core_mem_alloc())
|
||||
Rom_module(_rom_module_phys(header->base), header->size,
|
||||
(const char*)header->name);
|
||||
(char const *)header->name);
|
||||
_rom_fs.insert(rom_module);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user