From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] suspend: off by one in pm_suspend()
Date: Wed, 21 Sep 2011 19:02:30 +0000 [thread overview]
Message-ID: <201109212102.30516.rjw@sisk.pl> (raw)
In-Reply-To: <20110920070336.GA19289@elgon.mountain>
On Tuesday, September 20, 2011, Dan Carpenter wrote:
> 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>
Applied to linux-pm/linux-next, will be pushed for 3.2.
Thanks,
Rafael
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 1d58583..4953dc0 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -321,7 +321,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++;
>
>
prev parent reply other threads:[~2011-09-21 19:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 7:03 [patch] suspend: off by one in pm_suspend() Dan Carpenter
2011-09-21 19:02 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201109212102.30516.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox