Browse Source

spi: jcore: disable clock when registering spi conroller failed

 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>
Takuo Koguchi 7 years ago
parent
commit
16eab16ef9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/spi/spi-jcore.c

+ 3 - 1
drivers/spi/spi-jcore.c

@@ -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;