Re: [PATCH 4/7] hw/hexagon: fix machine->fdt leak in qom-test
Philippe Mathieu-Daudé <[email protected]> Mon, 27 Jul 2026 08:41:27 +0200
| Newsgroups | org.kernel.vger.linux-cxl,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On 25/7/26 16:00, Marc-André Lureau wrote:
> virt_instance_init() built the FDT unconditionally at QOM
> instance-init time, so simply instantiating the object (e.g. via
> qom-test's introspection, without ever realizing the machine) leaked
> the 1MB FDT blob: machine_finalize() does not free machine->fdt.
>
> Other boards (arm/virt, riscv/virt, ...) build the FDT lazily from
> their MachineClass::init callback, which only runs when the machine
> is actually selected to boot. Do the same here by moving create_fdt()
> into virt_init().
>
> Fixes: 88a8bc7f43ff ("hw/hexagon: Define hexagon "virt" machine")
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
> hw/hexagon/virt.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>