From 6f330cc07941e844b925345043ef3ac7c44595c7 Mon Sep 17 00:00:00 2001 From: msmith Date: Sat, 7 Jul 2001 10:18:10 +0000 Subject: Get the ACPI softc before we potentially dereference it. --- sys/dev/acpica/Osd/OsdInterrupt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c index e6443ca..c45564f 100644 --- a/sys/dev/acpica/Osd/OsdInterrupt.c +++ b/sys/dev/acpica/Osd/OsdInterrupt.c @@ -57,6 +57,11 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine FUNCTION_TRACE(__func__); + if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL) + panic("can't find ACPI device to register interrupt"); + if (sc->acpi_dev == NULL) + panic("acpi softc has invalid device"); + if ((InterruptNumber < 0) || (InterruptNumber > 255)) return_ACPI_STATUS(AE_BAD_PARAMETER); if (ServiceRoutine == NULL) @@ -67,11 +72,6 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine } InterruptHandler = ServiceRoutine; - if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL) - panic("can't find ACPI device to register interrupt"); - if (sc->acpi_dev == NULL) - panic("acpi softc has invalid device"); - /* * This isn't strictly true, as we ought to be able to handle > 1 interrupt. The ACPI * spec doesn't call for this though. -- cgit v1.1