aboutsummaryrefslogtreecommitdiff
path: root/hw/xtensa
diff options
context:
space:
mode:
authorChen Qun <kuhn.chenqun@huawei.com>2020-02-18 17:11:54 +0800
committerLaurent Vivier <laurent@vivier.eu>2020-02-19 10:33:38 +0100
commitd1cb67841ca213802ee789957188ec87e8b7996d (patch)
treef92ed0c23ee46037763934211746fb8d88e844d1 /hw/xtensa
parent757ca9b81a5d96db5194456ea66dc00bcf618323 (diff)
hw/xtensa/xtfpga:fix leak of fdevice tree blob
The device tree blob returned by load_device_tree is malloced. We should free it after cpu_physical_memory_write(). Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200218091154.21696-4-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/xtensa')
-rw-r--r--hw/xtensa/xtfpga.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 8e2dd1327a..60ccc74f5f 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -380,6 +380,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
sizeof(dtb_addr), &dtb_addr);
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
+ g_free(fdt);
}
#else
if (dtb_filename) {