diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2001-11-23 05:57:03 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2001-11-23 05:57:03 +0000 |
commit | 0825f414a50833cb2d352d12208a537c05c8cebf (patch) | |
tree | 87eae144324637fc76bd32d1620ef80ebb01c02f /sys | |
parent | 066850942f15016c1fa955751e47b15508c02247 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/dev/acpica/acpi.c | 3 |
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); |