[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] acpi-build: properly decrement objects' referen
From: |
Kirill Batuzov |
Subject: |
[Qemu-devel] [PATCH 2/4] acpi-build: properly decrement objects' reference counters |
Date: |
Fri, 18 Apr 2014 17:41:22 +0400 |
Object returned bu object_property_get_qobject needs it's reference counter to
be decremented when it is not needed by caller anymore.
Signed-off-by: Kirill Batuzov <address@hidden>
---
hw/i386/acpi-build.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c98df88..1ef8ca9 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -156,18 +156,21 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
} else {
pm->s3_disabled = false;
}
+ qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL);
if (o) {
pm->s4_disabled = qint_get_int(qobject_to_qint(o));
} else {
pm->s4_disabled = false;
}
+ qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL);
if (o) {
pm->s4_val = qint_get_int(qobject_to_qint(o));
} else {
pm->s4_val = false;
}
+ qobject_decref(o);
/* Fill in mandatory properties */
pm->sci_int = object_property_get_int(obj, ACPI_PM_PROP_SCI_INT, NULL);
@@ -973,6 +976,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
}
}
+ qobject_decref(bsel);
build_free_array(bus_table);
build_pci_bus_state_cleanup(child);
g_free(child);
@@ -1362,10 +1366,12 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
return false;
}
mcfg->mcfg_base = qint_get_int(qobject_to_qint(o));
+ qobject_decref(o);
o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL);
assert(o);
mcfg->mcfg_size = qint_get_int(qobject_to_qint(o));
+ qobject_decref(o);
return true;
}
--
1.7.10.4
- Re: [Qemu-devel] [PATCH 4/4] PortioList: fix PortioList uses so they do not leak memory, (continued)
- [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Kirill Batuzov, 2014/04/18
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Andreas Färber, 2014/04/18
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get _bsel with generic object_property_get_int, Kirill Batuzov, 2014/04/18
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Michael S. Tsirkin, 2014/04/20
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Igor Mammedov, 2014/04/22
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Michael S. Tsirkin, 2014/04/22
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Andreas Färber, 2014/04/22
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Igor Mammedov, 2014/04/22
- Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Kirill Batuzov, 2014/04/22
[Qemu-devel] [PATCH 2/4] acpi-build: properly decrement objects' reference counters,
Kirill Batuzov <=
Re: [Qemu-devel] [PATCH 0/4] Fix memory leaks in QEMU, Peter Maydell, 2014/04/18
Re: [Qemu-devel] [PATCH 0/4] Fix memory leaks in QEMU, Markus Armbruster, 2014/04/22