If acpi_get_i386_pci_host() returned NULL, acpi_get_pci_info() would crash before build_ssdt() gets called. Remove unnecessary check for NULL pci_host.
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/i386/acpi-build.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 3c7af74..20a7066 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1338,13 +1338,7 @@ build_ssdt(GArray *table_data, GArray *linker, aml_append(sb_scope, method); { - Object *pci_host; - PCIBus *bus = NULL; - - pci_host = acpi_get_i386_pci_host(); - if (pci_host) { - bus = PCI_HOST_BRIDGE(pci_host)->bus; - } + PCIBus *bus = PCI_HOST_BRIDGE(acpi_get_i386_pci_host())->bus; if (bus) { Aml *scope = aml_scope("PCI0"); -- 2.1.0