[PATCH 1/1] smbios: error handling for invalid addresses

Simon Glass sjg at chromium.org
Mon Jul 5 17:55:58 CEST 2021


Hi Heinrich,

On Sat, 15 May 2021 at 10:08, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> 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 at gmx.de>
> ---
>  arch/x86/lib/tables.c       | 13 +++++++++++--
>  lib/efi_loader/efi_smbios.c | 15 ++++++++-------
>  lib/smbios.c                |  4 +++-
>  3 files changed, 22 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

nit below

>
> diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
> index 1779bb3e11..ea834a5035 100644
> --- a/arch/x86/lib/tables.c
> +++ b/arch/x86/lib/tables.c
> @@ -3,6 +3,8 @@
>   * Copyright (C) 2015, Bin Meng <bmeng.cn at 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;

I think the function comments needs an update for the new error.

Regards

,Simon


More information about the U-Boot mailing list