diff options
author | Miao Yan <yanmiaobest@gmail.com> | 2016-05-22 19:37:12 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2016-05-23 15:18:00 +0800 |
commit | 05dd6f183c8c20f0176a67ac885f8143c0052203 (patch) | |
tree | f255cfee5d732140687928767db4888b28a7f70d /arch/x86 | |
parent | 099b2196e4a693968fd6205ac6d61f6eaab79fb1 (diff) | |
download | u-boot-05dd6f183c8c20f0176a67ac885f8143c0052203.tar.gz |
cmd: qfw: remove qemu_fwcfg_free_files()
This patch is part of the qfw refactor work.
The qemu_fwcfg_free_files() function is only used in error handling in
ACPI table generation, let's not make this a core function and move it
to the right place.
Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/cpu/qemu/acpi_table.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/cpu/qemu/acpi_table.c b/arch/x86/cpu/qemu/acpi_table.c index 49381acd29..b17fa03bc8 100644 --- a/arch/x86/cpu/qemu/acpi_table.c +++ b/arch/x86/cpu/qemu/acpi_table.c @@ -235,8 +235,17 @@ u32 write_acpi_tables(u32 addr) } out: - if (ret) - qemu_fwcfg_free_files(); + if (ret) { + struct fw_cfg_file_iter iter; + for (file = qemu_fwcfg_file_iter_init(&iter); + !qemu_fwcfg_file_iter_end(&iter); + file = qemu_fwcfg_file_iter_next(&iter)) { + if (file->addr) { + free((void *)file->addr); + file->addr = 0; + } + } + } free(table_loader); return addr; |