summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-10 13:29:29 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-18 11:39:13 -0500
commit6290dcede4d6a7de9d30e42f325aaf0c8d8baaee (patch)
treeb5b7fc81384683a5bb2ce47bd4cece57ae348eb6
parent1daafc8ba89c2494c330804d7c1d8a4dfc158b35 (diff)
downloadqemu-seabios-6290dcede4d6a7de9d30e42f325aaf0c8d8baaee.tar.gz
smbios: Make some smbios_build_tables() arguments optional
Make max_structure_size and number_of_structures optional, as we don't have those fields in SMBIOS 3.0 entry points. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--src/fw/biostables.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index 559a586..d65d91a 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -456,6 +456,9 @@ smbios_new_type_0(void *start,
/*
* Build tables using qtables as input, adding additional type 0
* table if necessary.
+ *
+ * @address and @length can't be NULL. @max_structure_size and
+ * @number_of_structures are optional and can be NULL.
*/
static int
smbios_build_tables(struct romfile_s *f_tables,
@@ -497,9 +500,10 @@ smbios_build_tables(struct romfile_s *f_tables,
need_t0 = 0;
} else {
*length += t0_len;
- if (t0_len > *max_structure_size)
+ if (max_structure_size && t0_len > *max_structure_size)
*max_structure_size = t0_len;
- (*number_of_structures)++;
+ if (number_of_structures)
+ (*number_of_structures)++;
}
}