mirror of
https://github.com/hardkernel/linux.git
synced 2026-05-31 16:26:41 +09:00
PM / Suspend: Off by one in pm_suspend()
commit 528f7ce6e4 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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4d25350da9
commit
ca9b9d7bf6
@@ -315,7 +315,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user