From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] PM: sleep: Fix error handling in dpm_prepare()
Date: Thu, 16 Dec 2021 20:44:13 +0100 [thread overview]
Message-ID: <b9d06e6378a7c3b0e0b2561ab2a971c8fa1ff3e9.camel@linux.intel.com> (raw)
In-Reply-To: <4717160.31r3eYUQgx@kreacher>
On Thu, 2021-12-16 at 20:30 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Commit 2aa36604e824 ("PM: sleep: Avoid calling put_device() under
> dpm_list_mtx") forgot to update the while () loop termination
> condition to also break the loop if error is nonzero, which
> causes the loop to become infinite if device_prepare() returns
> an error for one device.
>
> Add the missing !error check.
>
> Fixes: 2aa36604e824 ("PM: sleep: Avoid calling put_device() under
> dpm_list_mtx")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Thomas Hellström <thomas.hellstrom@linux.intel.com>
Was this meant to be a Reported-by:?
Also Cc stable? IIRC 2aa36604e824 was.
In any case,
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Thanks,
Thomas
> ---
> drivers/base/power/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-pm/drivers/base/power/main.c
> ===================================================================
> --- linux-pm.orig/drivers/base/power/main.c
> +++ linux-pm/drivers/base/power/main.c
> @@ -1902,7 +1902,7 @@ int dpm_prepare(pm_message_t state)
> device_block_probing();
>
> mutex_lock(&dpm_list_mtx);
> - while (!list_empty(&dpm_list)) {
> + while (!list_empty(&dpm_list) && !error) {
> struct device *dev = to_device(dpm_list.next);
>
> get_device(dev);
>
>
>
next prev parent reply other threads:[~2021-12-16 19:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 19:30 Rafael J. Wysocki
2021-12-16 19:44 ` Thomas Hellström [this message]
2021-12-16 19:49 ` Rafael J. Wysocki
2021-12-17 17:21 ` Ulf Hansson
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=b9d06e6378a7c3b0e0b2561ab2a971c8fa1ff3e9.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@linaro.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
all inboxes | Powered by JetHome®