spi: jcore: disable clock when registering spi conroller failed
authorTakuo Koguchi <takuo.koguchi@gmail.com>
Thu, 7 Dec 2017 10:11:41 +0000 (19:11 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 13 Dec 2017 19:08:24 +0000 (19:08 +0000)
 When probe function fails in registering the spi controller, the clock
 should remain disabled.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Takuo Koguchi <takuo.koguchi.sw@hitachi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-jcore.c

index cebfea5faa4be247e2b8e145d96c3925c6a32ec7..dafed6280df3285055306df409070a73ba8283cb 100644 (file)
@@ -198,8 +198,10 @@ static int jcore_spi_probe(struct platform_device *pdev)
 
        /* Register our spi controller */
        err = devm_spi_register_master(&pdev->dev, master);
-       if (err)
+       if (err) {
+               clk_disable(clk);
                goto exit;
+       }
 
        return 0;