[02/13] acpi: Remove unnecessary check for NULL pci_host
diff mbox

Message ID 1449094978-22986-3-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Dec. 2, 2015, 10:22 p.m. UTC
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 <ehabkost@redhat.com>
---
 hw/i386/acpi-build.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Patch
diff mbox

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");