aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorChen Qun <kuhn.chenqun@huawei.com>2020-02-18 17:11:53 +0800
committerDavid Gibson <david@gibson.dropbear.id.au>2020-02-21 09:15:04 +1100
commit438bafcac55308eef4f9029c94dbadd2c7ac3bb7 (patch)
treea9fec0167d033ee233e0332017a1d58136c7a540 /hw/ppc
parentab8584349c476f9818dc6403359c85f9ab0ad5eb (diff)
hw/ppc/virtex_ml507: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> Message-Id: <20200218091154.21696-3-kuhn.chenqun@huawei.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/virtex_ml507.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 91dd00ee91..4eef70069f 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -188,6 +188,7 @@ static int xilinx_load_device_tree(hwaddr addr,
if (r < 0)
fprintf(stderr, "couldn't set /chosen/bootargs\n");
cpu_physical_memory_write(addr, fdt, fdt_size);
+ g_free(fdt);
return fdt_size;
}