Skip to content

Commit

Permalink
spi: jcore: disable clock when registering spi conroller failed
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
Takuo Koguchi authored and Mark Brown committed Dec 13, 2017
1 parent 4fbd8d1 commit 16eab16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/spi/spi-jcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 16eab16

Please sign in to comment.