aboutsummaryrefslogtreecommitdiff
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
parentab8584349c476f9818dc6403359c85f9ab0ad5eb (diff)
downloadqemu-438bafcac55308eef4f9029c94dbadd2c7ac3bb7.zip
qemu-438bafcac55308eef4f9029c94dbadd2c7ac3bb7.tar.gz
qemu-438bafcac55308eef4f9029c94dbadd2c7ac3bb7.tar.bz2
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>
-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 91dd00e..4eef700 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;
}