All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/core/machine: fix fdt memory leak
@ 2026-07-09 11:12 marcandre.lureau
  2026-07-09 11:19 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marcandre.lureau @ 2026-07-09 11:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Philippe Mathieu-Daudé, Zhao Liu

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The MachineState fdt field is allocated by various machine types via
create_device_tree(), load_device_tree(), or similar, but was never
freed in machine_finalize(). Add the missing g_free() call.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/core/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 15886a56b19..f3073294d63 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1306,6 +1306,7 @@ static void machine_finalize(Object *obj)
     g_free(ms->nvdimms_state);
     g_free(ms->numa_state);
     g_free(ms->audiodev);
+    g_free(ms->fdt);
 }
 
 bool machine_usb(MachineState *machine)
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/core/machine: fix fdt memory leak
  2026-07-09 11:12 [PATCH] hw/core/machine: fix fdt memory leak marcandre.lureau
@ 2026-07-09 11:19 ` Peter Maydell
  2026-07-09 11:24 ` Philippe Mathieu-Daudé
  2026-07-09 14:57 ` Zhao Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2026-07-09 11:19 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, Philippe Mathieu-Daudé, Zhao Liu

On Thu, 9 Jul 2026 at 12:13, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The MachineState fdt field is allocated by various machine types via
> create_device_tree(), load_device_tree(), or similar, but was never
> freed in machine_finalize(). Add the missing g_free() call.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/core/machine.c | 1 +

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/core/machine: fix fdt memory leak
  2026-07-09 11:12 [PATCH] hw/core/machine: fix fdt memory leak marcandre.lureau
  2026-07-09 11:19 ` Peter Maydell
@ 2026-07-09 11:24 ` Philippe Mathieu-Daudé
  2026-07-09 14:57 ` Zhao Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-09 11:24 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: Philippe Mathieu-Daudé, Zhao Liu

On 9/7/26 13:12, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The MachineState fdt field is allocated by various machine types via
> create_device_tree(), load_device_tree(), or similar, but was never
> freed in machine_finalize(). Add the missing g_free() call.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   hw/core/machine.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/core/machine: fix fdt memory leak
  2026-07-09 11:12 [PATCH] hw/core/machine: fix fdt memory leak marcandre.lureau
  2026-07-09 11:19 ` Peter Maydell
  2026-07-09 11:24 ` Philippe Mathieu-Daudé
@ 2026-07-09 14:57 ` Zhao Liu
  2 siblings, 0 replies; 4+ messages in thread
From: Zhao Liu @ 2026-07-09 14:57 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, Philippe Mathieu-Daudé

On Thu, Jul 09, 2026 at 03:12:49PM +0400, marcandre.lureau@redhat.com wrote:
> Date: Thu,  9 Jul 2026 15:12:49 +0400
> From: marcandre.lureau@redhat.com
> Subject: [PATCH] hw/core/machine: fix fdt memory leak
> 
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The MachineState fdt field is allocated by various machine types via
> create_device_tree(), load_device_tree(), or similar, but was never
> freed in machine_finalize(). Add the missing g_free() call.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/core/machine.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-09 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 11:12 [PATCH] hw/core/machine: fix fdt memory leak marcandre.lureau
2026-07-09 11:19 ` Peter Maydell
2026-07-09 11:24 ` Philippe Mathieu-Daudé
2026-07-09 14:57 ` Zhao Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.