All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] hw/acpi: some cosmetic improvements to existing code
@ 2021-07-26 12:52 Ani Sinha
  0 siblings, 0 replies; only message in thread
From: Ani Sinha @ 2021-07-26 12:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ani Sinha, Igor Mammedov, jusual, Michael S. Tsirkin

All existing code using acpi_get_i386_pci_host() checks for a non-null
return from this function call. This change brings the same check to
acpi_pcihp_disable_root_bus() function.

Fixes: c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")

Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
 hw/acpi/pcihp.c | 5 +++++
 1 file changed, 5 insertions(+)

changelog:
v1: initial patch
v2: removed comment addition - that can be sent as a separate patch.

diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index f4d706e47d..856c6e1b47 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -136,6 +136,11 @@ static void acpi_pcihp_disable_root_bus(void)
         return;
     }
 
+    if (!host) {
+        root_hp_disabled = true;
+        return;
+    }
+
     bus = PCI_HOST_BRIDGE(host)->bus;
     if (bus) {
         /* setting the hotplug handler to NULL makes the bus non-hotpluggable */
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-26 12:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 12:52 [PATCH v2] hw/acpi: some cosmetic improvements to existing code Ani Sinha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.