提交 757ca9b8 编写于 作者: C Chen Qun 提交者: Laurent Vivier

hw/nios2: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: NEuler Robot <euler.robot@huawei.com>
Signed-off-by: NChen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
Message-Id: <20200218091154.21696-2-kuhn.chenqun@huawei.com>
Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
上级 b18ee6a2
...@@ -109,6 +109,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const uint32_t ramsize, ...@@ -109,6 +109,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const uint32_t ramsize,
} }
cpu_physical_memory_write(bi.fdt, fdt, fdt_size); cpu_physical_memory_write(bi.fdt, fdt, fdt_size);
g_free(fdt);
return fdt_size; return fdt_size;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册