iio: adc: xilinx: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Fri, 26 May 2017 06:37:41 +0000 (12:07 +0530)
committerJonathan Cameron <jic23@kernel.org>
Sat, 3 Jun 2017 08:55:23 +0000 (09:55 +0100)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/xilinx-xadc-core.c

index 56cf5907a5f010e30a73ce3e8fadaea692ca0c95..4a60497a1f193d0422973c70c5293fe60a456f09 100644 (file)
@@ -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)