drivers/emu/qemu: Add a comment about fw_cfg assumptions
This documents that if the fw_cfg table was improperly configured by QEMU, the fw_cfg_smbios_init() function would leak memory. We could add a check to verify that this doesn't happen, but honestly that seems like overkill. This just documents the issue in case this code is copied for use elsewhere. BUG=CIDs 1405799, 1405791, 1405792, 1405796, 1405797 Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I4f253194dae52897633ab5d96bb8c2964b8365d0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/88332 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
d866e72b3a
commit
1219981177
1 changed files with 6 additions and 0 deletions
|
|
@ -351,6 +351,12 @@ static const char *type1_serial_number;
|
|||
static const char *type1_family;
|
||||
static u8 type1_uuid[16];
|
||||
|
||||
/*
|
||||
* We're making an assumption that the table we get from fw_cfg_get() &
|
||||
* fw_cfg_read() only has one entry for each of the above fields. If
|
||||
* there's more than one, we would leak the memory created by strdup()
|
||||
* for the previous iterations through the loop.
|
||||
*/
|
||||
static void fw_cfg_smbios_init(void)
|
||||
{
|
||||
static int done = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue