summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2001-11-23 05:57:03 +0000
committeriwasaki <iwasaki@FreeBSD.org>2001-11-23 05:57:03 +0000
commit0825f414a50833cb2d352d12208a537c05c8cebf (patch)
tree87eae144324637fc76bd32d1620ef80ebb01c02f /sys/dev/acpica/acpi.c
parent066850942f15016c1fa955751e47b15508c02247 (diff)
downloadFreeBSD-src-0825f414a50833cb2d352d12208a537c05c8cebf.zip
FreeBSD-src-0825f414a50833cb2d352d12208a537c05c8cebf.tar.gz
Validate requested sleep state in acpi_SetSleepState() to avoid reentry
during wakeup procedure.
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r--sys/dev/acpica/acpi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index f6a0197..6295816 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1305,6 +1305,9 @@ acpi_SetSleepState(struct acpi_softc *sc, int state)
FUNCTION_TRACE_U32(__func__, state);
ACPI_ASSERTLOCK;
+ if (sc->acpi_sstate != ACPI_STATE_S0)
+ return_ACPI_STATUS(AE_BAD_PARAMETER); /* avoid reentry */
+
switch (state) {
case ACPI_STATE_S0: /* XXX only for testing */
status = AcpiEnterSleepState((UINT8)state);
OpenPOWER on IntegriCloud