[PATCH v2 08/10] mips/boston: Plug memory leak in boston_mach_init()

Markus Armbruster posted 10 patches 5 years, 6 months ago
Maintainers: Paul Durrant <paul@xen.org>, Richard Henderson <rth@twiddle.net>, Christian Borntraeger <borntraeger@de.ibm.com>, Stefano Stabellini <sstabellini@kernel.org>, Cornelia Huck <cohuck@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Fam Zheng <fam@euphon.net>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, David Hildenbrand <david@redhat.com>, Paul Burton <pburton@wavecomp.com>, Gerd Hoffmann <kraxel@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Juan Quintela <quintela@redhat.com>, Andrzej Zaborowski <balrogg@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>, Anthony Perard <anthony.perard@citrix.com>, Eduardo Habkost <ehabkost@redhat.com>, Jean-Christophe Dubois <jcd@tribudubois.net>, Eric Blake <eblake@redhat.com>
[PATCH v2 08/10] mips/boston: Plug memory leak in boston_mach_init()
Posted by Markus Armbruster 5 years, 6 months ago
Fixes: df1d8a1f29f567567b9d20be685a4241282e7005
Cc: Paul Burton <pburton@wavecomp.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/mips/boston.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 2832dfa6ae..a896056be1 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -426,7 +426,6 @@ static void boston_mach_init(MachineState *machine)
 {
     DeviceState *dev;
     BostonState *s;
-    Error *err = NULL;
     MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg;
     MemoryRegion *sys_mem = get_system_memory();
     XilinxPCIEHost *pcie2;
@@ -467,7 +466,8 @@ static void boston_mach_init(MachineState *machine)
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1);
 
     flash =  g_new(MemoryRegion, 1);
-    memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err);
+    memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB,
+                           &error_fatal);
     memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
 
     memory_region_add_subregion_overlap(sys_mem, 0x80000000, machine->ram, 0);
-- 
2.21.1


Re: [PATCH v2 08/10] mips/boston: Plug memory leak in boston_mach_init()
Posted by Aleksandar Markovic 5 years, 6 months ago
уторак, 05. мај 2020., Markus Armbruster <armbru@redhat.com> је написао/ла:

> Fixes: df1d8a1f29f567567b9d20be685a4241282e7005
> Cc: Paul Burton <pburton@wavecomp.com>
> Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/mips/boston.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
>
Thank you, Markus, for spotting this error.

Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>

I am fine with you selecting this and another mips-related patch in this
series in your pull request, that will be result of this series.

Truly yours,
Aleksandar




> diff --git a/hw/mips/boston.c b/hw/mips/boston.c
> index 2832dfa6ae..a896056be1 100644
> --- a/hw/mips/boston.c
> +++ b/hw/mips/boston.c
> @@ -426,7 +426,6 @@ static void boston_mach_init(MachineState *machine)
>  {
>      DeviceState *dev;
>      BostonState *s;
> -    Error *err = NULL;
>      MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg;
>      MemoryRegion *sys_mem = get_system_memory();
>      XilinxPCIEHost *pcie2;
> @@ -467,7 +466,8 @@ static void boston_mach_init(MachineState *machine)
>      sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1);
>
>      flash =  g_new(MemoryRegion, 1);
> -    memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err);
> +    memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB,
> +                           &error_fatal);
>      memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
>
>      memory_region_add_subregion_overlap(sys_mem, 0x80000000,
> machine->ram, 0);
> --
> 2.21.1
>
>
>