From: Arvind Yadav Date: Tue, 25 Jul 2017 10:14:32 +0000 (+0530) Subject: ASoC: samsung: spdif: Handle return value of clk_prepare_enable. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f11daf10b4ac6a6c8ea6b39552f119c595b5406;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ASoC: samsung: spdif: Handle return value of clk_prepare_enable. clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index 779504f54bc0..cb59911e65c0 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c @@ -391,7 +391,9 @@ static int spdif_probe(struct platform_device *pdev) ret = -ENOENT; goto err0; } - clk_prepare_enable(spdif->pclk); + ret = clk_prepare_enable(spdif->pclk); + if (ret) + goto err0; spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif"); if (IS_ERR(spdif->sclk)) { @@ -399,7 +401,9 @@ static int spdif_probe(struct platform_device *pdev) ret = -ENOENT; goto err1; } - clk_prepare_enable(spdif->sclk); + ret = clk_prepare_enable(spdif->sclk); + if (ret) + goto err1; /* Request S/PDIF Register's memory region */ if (!request_mem_region(mem_res->start,