aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-09-21 20:55:04 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2011-10-16 23:27:46 +0200
commit528f7ce6e439edeac38f6b3f8561f1be129b5e91 (patch)
tree6f03bc001aa170656f0d49f4f5afb6352027abaa /kernel/power
parent85055dd805f0822f13f736bee2a521e222c38293 (diff)
downloadkernel_goldelico_gta04-528f7ce6e439edeac38f6b3f8561f1be129b5e91.zip
kernel_goldelico_gta04-528f7ce6e439edeac38f6b3f8561f1be129b5e91.tar.gz
kernel_goldelico_gta04-528f7ce6e439edeac38f6b3f8561f1be129b5e91.tar.bz2
PM / Suspend: Off by one in pm_suspend()
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> Cc: stable@kernel.org
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/suspend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 595a3dd..fdd4263 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -319,7 +319,7 @@ int enter_state(suspend_state_t state)
int pm_suspend(suspend_state_t state)
{
int ret;
- if (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX) {
+ if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) {
ret = enter_state(state);
if (ret) {
suspend_stats.fail++;