mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Deepak Saxena <dsaxena@plexity.net>,
	Olivia Mackall <olivia@selenic.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ijae Kim <ae878000@gmail.com>
Subject: Re: [PATCH] hwrng: omap: Fix probe error path cleanup
Date: Sun, 5 Jul 2026 16:40:35 +0800	[thread overview]
Message-ID: <akoYg-74TuBEaXJ4@gondor.apana.org.au> (raw)
In-Reply-To: <20260623084612.58054-1-mhun512@gmail.com>

On Tue, Jun 23, 2026 at 05:42:23PM +0900, Myeonghun Pak wrote:
> omap_rng_probe() enables runtime PM before acquiring and enabling the
> functional clocks.  Several later error paths returned or unwound without
> undoing all state acquired so far.
> 
> If pm_runtime_resume_and_get() failed, the driver returned through the
> generic ioremap error label and left runtime PM enabled.  If either clock
> lookup returned -EPROBE_DEFER, the function returned directly and skipped
> the runtime PM cleanup; the register clock defer path could also leave the
> already enabled functional clock prepared.
> 
> Route these failures through the existing unwind labels so each path only
> undoes resources that were acquired successfully.  Keep the resume failure
> path limited to pm_runtime_disable(), and use the later labels only after
> the runtime PM usage count or clocks have been acquired.
> 
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
> 
> Fixes: 61dc0a446e5d ("hwrng: omap - Fix assumption that runtime_get_sync will always succeed")
> Fixes: 43ec540e6f9b ("hwrng: omap - move clock related code to omap_rng_probe()")
> Fixes: b166be004491 ("hwrng: omap - Fix clock resource by adding a register clock")
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> 
> ---
>  drivers/char/hw_random/omap-rng.c | 30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2026-07-05  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  8:42 Myeonghun Pak
2026-07-05  8:40 ` Herbert Xu [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=akoYg-74TuBEaXJ4@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=ae878000@gmail.com \
    --cc=dsaxena@plexity.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhun512@gmail.com \
    --cc=olivia@selenic.com \
    /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®