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>
This commit is contained in:
Takuo Koguchi 2017-12-07 19:11:41 +09:00 committed by Mark Brown
parent 4fbd8d194f
commit 16eab16ef9
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

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