From 05dd6f183c8c20f0176a67ac885f8143c0052203 Mon Sep 17 00:00:00 2001 From: Miao Yan Date: Sun, 22 May 2016 19:37:12 -0700 Subject: 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 Reviewed-by: Bin Meng --- arch/x86/cpu/qemu/acpi_table.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'arch/x86') diff --git a/arch/x86/cpu/qemu/acpi_table.c b/arch/x86/cpu/qemu/acpi_table.c index 49381ac..b17fa03 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; -- cgit v1.1