Re: [PATCH] hwrng: stm32 - add missing clk_disable_unprepare() in stm32_rng_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yang,

Good spot, thank you.

Reviewed-by: Gatien Chevallier <gatien.chevallier@xxxxxxxxxxx>

Best regards,
Gatien

On 12/1/23 09:20, Yang Yingliang wrote:
From: Yang Yingliang <yangyingliang@xxxxxxxxxx>

Add clk_disable_unprepare() in the error path in stm32_rng_init().

Fixes: 6b85a7e141cb ("hwrng: stm32 - implement STM32MP13x support")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
  drivers/char/hw_random/stm32-rng.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 41e1dbea5d2e..efd6edcd7066 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -325,6 +325,7 @@ static int stm32_rng_init(struct hwrng *rng)
  							(!(reg & RNG_CR_CONDRST)),
  							10, 50000);
  		if (err) {
+			clk_disable_unprepare(priv->clk);
  			dev_err((struct device *)priv->rng.priv,
  				"%s: timeout %x!\n", __func__, reg);
  			return -EINVAL;




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux