From: Philipp Zabel <p.zabel@pengutronix.de>
To: WenTao Liang <vulab@iscas.ac.cn>
Cc: Hans de Goede <hansg@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] reset: fix refcount leak in reset_control_bulk_assert()
Date: Thu, 11 Jun 2026 10:13:02 +0200 [thread overview]
Message-ID: <aipuDoAJA4ToqxUI@pengutronix.de> (raw)
In-Reply-To: <20260611015731.57989-1-vulab@iscas.ac.cn>
On Thu, Jun 11, 2026 at 09:57:31AM +0800, WenTao Liang wrote:
> When reset_control_bulk_assert() asserts a batch of reset controls,
> it calls reset
Can you write a better commit message?
What does this patch accomplish, and why?
> Fixes: 0b52297f2288 ("reset: Add support for shared reset controls")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
> ---
> drivers/reset/core.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index 38e189d04d09..daf9201bc105 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -516,8 +516,15 @@ int reset_control_assert(struct reset_control *rstc)
> if (WARN_ON(atomic_read(&rstc->deassert_count) == 0))
> return -EINVAL;
>
> - if (atomic_dec_return(&rstc->deassert_count) != 0)
> + if (atomic_dec_return(&rstc->deassert_count) != 0) {
> + int err = rcdev->ops->assert(rcdev, rstc->id);
This is wrong, asserting the reset must not happen unless deassert_count
has been decremented to zero.
regards
Philipp
prev parent reply other threads:[~2026-06-11 8:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 1:57 [PATCH] reset: fix refcount leak in reset_control_bulk_assert() WenTao Liang
2026-06-11 8:13 ` Philipp Zabel [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=aipuDoAJA4ToqxUI@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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