qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 02/13] acpi: Remove unnecessary check for NULL pci_h


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 02/13] acpi: Remove unnecessary check for NULL pci_host
Date: Wed, 2 Dec 2015 20:22:47 -0200

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]