From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Bartosz Golaszewski <brgl@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Chen-Yu Tsai <wens@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
stable@vger.kernel.org
Subject: [PATCH v2 1/4] power: sequencing: don't call .post_enable() if pwrseq_unit_enable() failed
Date: Wed, 09 Sep 2026 14:37:07 +0200 [thread overview]
Message-ID: <20260909-pwrseq-kunit-v2-1-ef496afc89d2@oss.qualcomm.com> (raw)
In-Reply-To: <20260909-pwrseq-kunit-v2-0-ef496afc89d2@oss.qualcomm.com>
If the call to pwrseq_unit_enable() failed in pwrseq_enable(), bail out
instead of calling target->post_enable() which assumes the target was
successfully enabled.
Fixes: 249ebf3f65f8 ("power: sequencing: implement the pwrseq core")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/power/sequencing/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/power/sequencing/core.c b/drivers/power/sequencing/core.c
index 0cb71efbb268b351607ccf610cbf0315f35eb3b7..a26615b727f6fe8e7cdc3ab1d3f362ba2f1c5684 100644
--- a/drivers/power/sequencing/core.c
+++ b/drivers/power/sequencing/core.c
@@ -912,6 +912,8 @@ int pwrseq_enable(struct pwrseq_desc *desc)
if (!ret)
desc->powered_on = true;
}
+ if (ret)
+ return ret;
if (target->post_enable) {
ret = target->post_enable(pwrseq);
--
2.47.3
next prev parent reply other threads:[~2026-09-09 12:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 12:37 [PATCH v2 0/4] power: sequencing: add kunit test cases Bartosz Golaszewski
2026-09-09 12:37 ` Bartosz Golaszewski [this message]
2026-09-09 12:37 ` [PATCH v2 2/4] power: sequencing: fix NULL-pointer dereference in pwrseq_unit_new() Bartosz Golaszewski
2026-09-09 12:37 ` [PATCH v2 3/4] power: sequencing: fix NULL-pointer dereference in pwrseq_device_register() Bartosz Golaszewski
2026-09-09 12:37 ` [PATCH v2 4/4] power: sequencing: add kunit test cases Bartosz Golaszewski
2026-09-14 7:27 ` (subset) [PATCH v2 0/4] " Bartosz Golaszewski
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=20260909-pwrseq-kunit-v2-1-ef496afc89d2@oss.qualcomm.com \
--to=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mani@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wens@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
all inboxes | Powered by JetHome®