summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2001-07-07 10:18:10 +0000
committermsmith <msmith@FreeBSD.org>2001-07-07 10:18:10 +0000
commit6f330cc07941e844b925345043ef3ac7c44595c7 (patch)
tree47b6513576d486dd23a6d11b779304d2b63cdadd
parent631a99c4b2da96866dfb72297b0062eef33f5832 (diff)
downloadFreeBSD-src-6f330cc07941e844b925345043ef3ac7c44595c7.zip
FreeBSD-src-6f330cc07941e844b925345043ef3ac7c44595c7.tar.gz
Get the ACPI softc before we potentially dereference it.
-rw-r--r--sys/dev/acpica/Osd/OsdInterrupt.c10
1 files 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.
OpenPOWER on IntegriCloud