hwrng: bcm2835 - Add missing clk_disable_unprepare in bcm2835_rng_init
authorGaosheng Cui <cuigaosheng1@huawei.com>
Sat, 3 Aug 2024 06:49:22 +0000 (14:49 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 10 Aug 2024 04:25:34 +0000 (12:25 +0800)
Add the missing clk_disable_unprepare() before return in
bcm2835_rng_init().

Fixes: e5f9f41d5e62 ("hwrng: bcm2835 - add reset support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/bcm2835-rng.c

index b03e803..aa2b135 100644 (file)
@@ -94,8 +94,10 @@ static int bcm2835_rng_init(struct hwrng *rng)
                return ret;
 
        ret = reset_control_reset(priv->reset);
-       if (ret)
+       if (ret) {
+               clk_disable_unprepare(priv->clk);
                return ret;
+       }
 
        if (priv->mask_interrupts) {
                /* mask the interrupt */