Skip to contentSkip to conversation

pci: Fix memory leak

PATCH In review Stefan Weil 3 participants 5 messages Jan 22, 2011 – Feb 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 pci: Fix memory leak

---
 hw/pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/pci.c +1 -0
index 63f476a..38a60ae 100644
@@ -1877,6 +1877,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
     if (size < 0) {
         error_report("%s: failed to find romfile \"%s\"",
                      __FUNCTION__, pdev->romfile);
+        qemu_free(path);
         return -1;
     }
     if (size & (size - 1)) {
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/3 ppc405: Fix memory leak

---
 hw/ppc405_boards.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/ppc405_boards.c +1 -0
index b1d2b94..912757b 100644
@@ -560,6 +560,7 @@ static void taihu_405ep_init(ram_addr_t ram_size,
         filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (filename) {
             bios_size = load_image(filename, qemu_get_ram_ptr(bios_offset));
+            qemu_free(filename);
         } else {
             bios_size = -1;
         }
Signature · 1 line
1.7.2.3
Acked-by on v1 2/3
#2 lore raw

Re: [Qemu-devel] [PATCH 2/3] ppc405: Fix memory leak

Am 22.01.2011 um 13:02 schrieb Stefan Weil:

Quoted 1 line
Quoted 16 lines

---
hw/ppc405_boards.c | 1 +

1 files changed, 1 insertions(+), 0 deletions(-)
hw/ppc405_boards.c +1 -0
index b1d2b94..912757b 100644
@@ -560,6 +560,7 @@ static void taihu_405ep_init(ram_addr_t ram_size,
        filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
        if (filename) {
            bios_size = load_image(filename,  
 qemu_get_ram_ptr(bios_offset));
+            qemu_free(filename);
        } else {
            bios_size = -1;
Quoted 1 line
        }

Untested but matches the 405 reference board and New World / Old World / PReP then.

Andreas

#3 lore raw

PATCH 3/3 s390: Fix memory leak

In reply to Stefan Weil
---
 hw/s390-virtio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/s390-virtio.c +1 -0
index f29b624..850422f 100644
@@ -204,6 +204,7 @@ static void s390_init(ram_addr_t ram_size,
 
         bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         bios_size = load_image(bios_filename, qemu_get_ram_ptr(ZIPL_LOAD_ADDR));
+        qemu_free(bios_filename);
 
         if ((long)bios_size < 0) {
             hw_error("could not load bootloader '%s'\n", bios_name);
Signature · 1 line
1.7.2.3
#4 lore raw
In reply to Stefan Weil
Quoted 4 lines · Stefan Weil
---
 hw/pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Thanks all three patches applied.

Quoted 17 lines
hw/pci.c +1 -0
index 63f476a..38a60ae 100644
@@ -1877,6 +1877,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
     if (size < 0) {
         error_report("%s: failed to find romfile \"%s\"",
                      __FUNCTION__, pdev->romfile);
+        qemu_free(path);
         return -1;
     }
     if (size & (size - 1)) {
Signature · 1 line
1.7.2.3
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net