mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nishanth Menon <nm@ti.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Olivia Mackall" <olivia@selenic.com>,
	"Alexander Sverdlin" <alexander.sverdlin@nokia.com>,
	"Alexander Sverdlin" <alexander.sverdlin@gmail.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] hwrng: fix division by zero in ks_sa_rng_init
Date: Sun, 28 Sep 2025 11:58:14 +0800	[thread overview]
Message-ID: <aNiyVogNAXQ3AtuT@gondor.apana.org.au> (raw)
In-Reply-To: <20250919132002.180874-1-nm@ti.com>

On Fri, Sep 19, 2025 at 08:20:02AM -0500, Nishanth Menon wrote:
> Fix division by zero in ks_sa_rng_init caused by missing clock
> pointer initialization. The clk_get_rate() call is performed on
> an uninitialized clk pointer, resulting in division by zero when
> calculating delay values.
> 
> Add clock initialization code before using the clock.
> 
> Fixes: 6d01d8511dce ("hwrng: ks-sa - Add minimum sleep time before ready-polling")
> Signed-off-by: Nishanth Menon <nm@ti.com>
> 
>  drivers/char/hw_random/ks-sa-rng.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> ---
> 
> Noticed this when looking at kci logs:
> https://dashboard.kernelci.org/log-viewer?itemId=ti%3A0af42187f4b24261b0c102f0&org=ti&type=test&url=http%3A%2F%2Ffiles.kernelci.org%2F%2Fti%2Fmainline%2Fmaster%2Fv6.17-rc6-43-g8b789f2b7602%2Farm%2Fmulti_v7_defconfig%2BCONFIG_EFI%3Dy%2BCONFIG_ARM_LPAE%3Dy%2Bdebug%2Bkselftest%2Btinyconfig%2Fgcc-12%2Fbaseline-nfs-boot.nfs-k2hk-evm.txt.gz
> 
> Fixed version boot:
> https://gist.github.com/nmenon/0996e5f7bdbcd3b014cee9921a60d88c
> 
>  drivers/char/hw_random/ks-sa-rng.c | 4 ++++
>  1 file changed, 4 insertions(+)

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

      parent reply	other threads:[~2025-09-28  3:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 13:20 Nishanth Menon
2025-09-20  7:23 ` Alexander Sverdlin
2025-09-28  3:58 ` 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=aNiyVogNAXQ3AtuT@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=alexander.sverdlin@gmail.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=olivia@selenic.com \
    --cc=u.kleine-koenig@baylibre.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®