diff mbox series

[v1,1/1] hw/arm: versal: Plug memory leaks

Message ID 20190104104749.5314-2-edgar.iglesias@gmail.com (mailing list archive)
State New, archived
Headers show
Series hw/arm: versal: Fix memory leaks | expand

Commit Message

Edgar E. Iglesias Jan. 4, 2019, 10:47 a.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Plug a couple of "board creation time" memory leaks.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 hw/arm/xlnx-versal-virt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Jan. 4, 2019, 12:10 p.m. UTC | #1
On 1/4/19 11:47 AM, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> 
> Plug a couple of "board creation time" memory leaks.
> 

Fixes 6f16da53ffe

> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>

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

> ---
>  hw/arm/xlnx-versal-virt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
> index c6feeac532..f95fde2309 100644
> --- a/hw/arm/xlnx-versal-virt.c
> +++ b/hw/arm/xlnx-versal-virt.c
> @@ -130,6 +130,7 @@ static void fdt_add_gic_nodes(VersalVirt *s)
>                                   2, MM_GIC_APU_REDIST_0_SIZE);
>      qemu_fdt_setprop_cell(s->fdt, nodename, "#interrupt-cells", 3);
>      qemu_fdt_setprop_string(s->fdt, nodename, "compatible", "arm,gic-v3");
> +    g_free(nodename);
>  }
>  
>  static void fdt_add_timer_nodes(VersalVirt *s)
> @@ -364,6 +365,7 @@ static void create_virtio_regions(VersalVirt *s)
>          sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
>          mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
>          memory_region_add_subregion(&s->soc.mr_ps, base, mr);
> +        g_free(name);
>      }
>  
>      for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
>
diff mbox series

Patch

diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index c6feeac532..f95fde2309 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -130,6 +130,7 @@  static void fdt_add_gic_nodes(VersalVirt *s)
                                  2, MM_GIC_APU_REDIST_0_SIZE);
     qemu_fdt_setprop_cell(s->fdt, nodename, "#interrupt-cells", 3);
     qemu_fdt_setprop_string(s->fdt, nodename, "compatible", "arm,gic-v3");
+    g_free(nodename);
 }
 
 static void fdt_add_timer_nodes(VersalVirt *s)
@@ -364,6 +365,7 @@  static void create_virtio_regions(VersalVirt *s)
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
         memory_region_add_subregion(&s->soc.mr_ps, base, mr);
+        g_free(name);
     }
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {