aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-05-15 18:07:47 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-07-24 10:49:51 +0200
commitc193d9bd284565df4ddcdd1e9190d2ce718e9eb7 (patch)
treeaad6c530d29fcb91f35e632e8237c43fb4f73b16 /arch
parent11275e4f72d6d2170db444df95e8f6b6ab627e8e (diff)
downloadu-boot-c193d9bd284565df4ddcdd1e9190d2ce718e9eb7.zip
u-boot-c193d9bd284565df4ddcdd1e9190d2ce718e9eb7.tar.gz
u-boot-c193d9bd284565df4ddcdd1e9190d2ce718e9eb7.tar.bz2
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/tables.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 1779bb3..ea834a5 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -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;