hwrng: st - Fix missing clk_disable_unprepare() on error in st_rng_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 10 Sep 2016 12:03:42 +0000 (12:03 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 13 Sep 2016 12:27:24 +0000 (20:27 +0800)
Fix the missing clk_disable_unprepare() before return
from st_rng_probe() in the error handling case.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/st-rng.c

index 7e8aa6b..938ec10 100644 (file)
@@ -108,6 +108,7 @@ static int st_rng_probe(struct platform_device *pdev)
        ret = hwrng_register(&ddata->ops);
        if (ret) {
                dev_err(&pdev->dev, "Failed to register HW RNG\n");
+               clk_disable_unprepare(clk);
                return ret;
        }