mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-07 12:49:24 +00:00
smbios: empty strings in smbios_add_string()
smbios_add_string() cannot deal with empty strings. This leads to incorrect property values and invalid tables. E.g. for the pine64-lts_defconfig CONFIG_SMBIOS_MANUFACTURER="". Linux command dmidecode shows: Table 1: Manufacturer: sunxi Product Name: sunxi Table 3: Invalid entry length (2). DMI table is broken! Stop. Replace empty strings by "Unknown". Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
88bd5b1793
commit
00a871d34e
1 changed files with 2 additions and 0 deletions
|
@ -31,6 +31,8 @@ static int smbios_add_string(char *start, const char *str)
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
char *p = start;
|
char *p = start;
|
||||||
|
if (!*str)
|
||||||
|
str = "Unknown";
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!*p) {
|
if (!*p) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue