提交 528f7ce6 编写于 作者: D Dan Carpenter 提交者: Rafael J. Wysocki

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
上级 85055dd8
......@@ -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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册