diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-09-21 20:55:04 +0200 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-08-17 15:35:52 -0400 |
commit | 7db9f90917b40dde4c5ea003cf58cd9eddb557c1 (patch) | |
tree | 2eca3623ab5729ce8263fb8eac80210bf1a6b650 | |
parent | c6817c1778ce37b9bb5a65881675f4cae17312f8 (diff) |
PM / Suspend: Off by one in pm_suspend()
commit 528f7ce6e439edeac38f6b3f8561f1be129b5e91 upstream.
In enter_state() we use "state" as an offset for the pm_states[]
array. The pm_states[] array only has PM_SUSPEND_MAX elements so
this test is off by one.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | kernel/power/suspend.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 56e7dbb8b996..7d4ae3b7b5b0 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -297,7 +297,7 @@ int enter_state(suspend_state_t state) */ int pm_suspend(suspend_state_t state) { - if (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX) + if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) return enter_state(state); return -EINVAL; } |