diff options
| author | Zhenlei Huang <zlei@FreeBSD.org> | 2023-11-02 09:07:11 +0000 |
|---|---|---|
| committer | Zhenlei Huang <zlei@FreeBSD.org> | 2023-11-02 09:07:11 +0000 |
| commit | 63bf943d4af17799cef21e2bb78dd28003ce1ce5 (patch) | |
| tree | 1205f9781980918af3db9ccda2f9623a7fdd4c61 /sys/dev/hyperv | |
| parent | 1d46c8e5c2702c141c6be982b3ca44e74d1cb8f1 (diff) | |
Diffstat (limited to 'sys/dev/hyperv')
| -rw-r--r-- | sys/dev/hyperv/vmbus/vmbus.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index ee412e643b4f..0ea401507b79 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -1393,7 +1393,7 @@ vmbus_doattach(struct vmbus_softc *sc) int ret; device_t dev_res; ACPI_HANDLE handle; - unsigned int coherent; + unsigned int coherent = 0; if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) return (0); @@ -1416,10 +1416,12 @@ vmbus_doattach(struct vmbus_softc *sc) /* Coherency attribute */ dev_res = devclass_get_device(devclass_find("vmbus_res"), 0); - handle = acpi_get_handle(dev_res); + if (dev_res != NULL) { + handle = acpi_get_handle(dev_res); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &coherent))) - coherent = 0; + if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &coherent))) + coherent = 0; + } if (bootverbose) device_printf(sc->vmbus_dev, "Bus is%s cache-coherent\n", coherent ? "" : " not"); |
