svn commit: r191699 - head/sys/dev/acpica

Jung-uk Kim jkim at FreeBSD.org
Thu Apr 30 18:00:54 UTC 2009


Author: jkim
Date: Thu Apr 30 18:00:53 2009
New Revision: 191699
URL: http://svn.freebsd.org/changeset/base/191699

Log:
  Fix off-by-one bug.  S5 state must be checked as well.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Thu Apr 30 17:47:52 2009	(r191698)
+++ head/sys/dev/acpica/acpi.c	Thu Apr 30 18:00:53 2009	(r191699)
@@ -3317,7 +3317,7 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_A
 	new_state = acpi_sname2sstate(sleep_state);
 	if (new_state < ACPI_STATE_S1)
 	    return (EINVAL);
-	if (new_state < ACPI_S_STATES_MAX && !acpi_sleep_states[new_state])
+	if (new_state < ACPI_S_STATE_COUNT && !acpi_sleep_states[new_state])
 	    return (EOPNOTSUPP);
 	if (new_state != old_state)
 	    *(int *)oidp->oid_arg1 = new_state;


More information about the svn-src-all mailing list