mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Get the ACPI softc before we potentially dereference it.
This commit is contained in:
parent
30185bcabe
commit
db302f9945
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79386
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user