From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4UcU-0004Mj-Jd for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4UcQ-0007Dt-TK for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4UcQ-0007Dp-Nu for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:22 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 55DB7C0A8024 for ; Thu, 3 Dec 2015 14:12:22 +0000 (UTC) From: Eduardo Habkost Date: Wed, 2 Dec 2015 20:22:47 -0200 Message-Id: <1449094978-22986-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> References: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 02/13] acpi: Remove unnecessary check for NULL pci_host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Marcel Apfelbaum , "Michael S. Tsirkin" 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 --- 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