mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
smbios: error handling for invalid addresses
SMBIOS tables only support 32bit addresses. If we don't have memory here handle the error gracefully: * on x86_64 fail to start U-Boot * during UEFI booting ignore the missing table Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
11275e4f72
commit
c193d9bd28
4 changed files with 27 additions and 12 deletions
|
@ -3,6 +3,8 @@
|
|||
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
|
||||
*/
|
||||
|
||||
#define LOG_CATEGORY LOGC_BOARD
|
||||
|
||||
#include <common.h>
|
||||
#include <bloblist.h>
|
||||
#include <log.h>
|
||||
|
@ -96,13 +98,20 @@ int write_tables(void)
|
|||
return log_msg_ret("bloblist", -ENOBUFS);
|
||||
}
|
||||
rom_table_end = table->write(rom_table_start);
|
||||
rom_table_end = ALIGN(rom_table_end, ROM_TABLE_ALIGN);
|
||||
if (!rom_table_end) {
|
||||
log_err("Can't create configuration table %d\n", i);
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_SEABIOS)) {
|
||||
table_size = rom_table_end - rom_table_start;
|
||||
high_table = (u32)(ulong)high_table_malloc(table_size);
|
||||
if (high_table) {
|
||||
table->write(high_table);
|
||||
if (!table->write(high_table)) {
|
||||
log_err("Can't create configuration table %d\n",
|
||||
i);
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
cfg_tables[i].start = high_table;
|
||||
cfg_tables[i].size = table_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue