[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1345060109-9187-126-git-send-email-paul.gortmaker@windriver.com>
Date: Wed, 15 Aug 2012 15:47:49 -0400
From: Paul Gortmaker <paul.gortmaker@...driver.com>
To: <stable@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Dan Carpenter <dan.carpenter@...cle.com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Paul Gortmaker <paul.gortmaker@...driver.com>
Subject: [v2.6.34-stable 125/165] PM / Suspend: Off by one in pm_suspend()
From: Dan Carpenter <dan.carpenter@...cle.com>
-------------------
This is a commit scheduled for the next v2.6.34 longterm release.
http://git.kernel.org/?p=linux/kernel/git/paulg/longterm-queue-2.6.34.git
If you see a problem with using this for longterm, please comment.
-------------------
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@...cle.com>
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
Signed-off-by: Paul Gortmaker <paul.gortmaker@...driver.com>
---
kernel/power/suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 56e7dbb..7d4ae3b 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;
}
--
1.7.12.rc2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists