From: Arvind Yadav Date: Fri, 26 May 2017 06:37:41 +0000 (+0530) Subject: iio: adc: xilinx: Handle return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a178fd7327e13ec7f8079a06a20b0ee42ade1eb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iio: adc: xilinx: 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 56cf5907a5f0..4a60497a1f19 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1204,7 +1204,10 @@ static int xadc_probe(struct platform_device *pdev) ret = PTR_ERR(xadc->clk); goto err_free_samplerate_trigger; } - clk_prepare_enable(xadc->clk); + + ret = clk_prepare_enable(xadc->clk); + if (ret) + goto err_free_samplerate_trigger; ret = xadc->ops->setup(pdev, indio_dev, irq); if (ret)