u-boot/0011-smbios-Fix-table-when-no-string-is-.patch
Dirk Mueller f39b767ea5 Accepting request 1120007 from home:mbrugger:branches:hardware:boot
Fix boo#1216036. Tested on RPi4. Boot from USB and uSD fine.
For details see: https://lore.kernel.org/u-boot/20231023070216.394709-1-sjg@chromium.org/#t
* Patches added:
  0018-Revert-bootstd-Scan-all-bootdevs-in.patch
  0019-bootstd-Expand-boot-ordering-test-t.patch
  0020-bootstd-Correct-logic-for-single-uc.patch
  0021-bootstd-Scan-all-bootdevs-in-a-boot.patch

OBS-URL: https://build.opensuse.org/request/show/1120007
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=201
2023-10-26 06:37:38 +00:00

34 lines
1.0 KiB
Diff

From 26f8b6445177efe725b16a14b82a016f2379c341 Mon Sep 17 00:00:00 2001
From: Matthias Brugger <mbrugger@suse.com>
Date: Wed, 17 Mar 2021 12:20:32 +0100
Subject: [PATCH] smbios: Fix table when no string is present
When no string is present in a table, next_ptr points to the same
location as eos. When calculating the string table length, we would only
reserve one \0. By spec a SMBIOS table has to end with two \0\0 when no
strings a present.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Series-to: sjg@chromium.org
Series-cc: bmeng.cn@gmail.com
Series-cc: xypron.glpk@gmx.de
Series-cc: u-boot@lists.denx.de
---
lib/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/smbios.c b/lib/smbios.c
index d7f4999e8b2..2cdfef7a2c9 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -172,7 +172,7 @@ static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop)
static void smbios_set_eos(struct smbios_ctx *ctx, char *eos)
{
ctx->eos = eos;
- ctx->next_ptr = eos;
+ ctx->next_ptr = eos + 1;
ctx->last_str = NULL;
}