]> Git Repo - linux.git/commitdiff
iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
authorChristophe JAILLET <[email protected]>
Sun, 17 May 2020 09:59:53 +0000 (11:59 +0200)
committerJonathan Cameron <[email protected]>
Sun, 5 Jul 2020 13:22:48 +0000 (14:22 +0100)
If 'ad7780_init_gpios()' fails, we must not release some resources that
have not been allocated yet. Return directly instead.

Fixes: 5bb30e7daf00 ("staging: iio: ad7780: move regulator to after GPIO init")
Fixes: 9085daa4abcc ("staging: iio: ad7780: add gain & filter gpio support")
Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Renato Lui Geh <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/adc/ad7780.c

index f47606ebbbbef489c42586e00e290705c838f57b..b33fe6c3907e560254eaf8271c85bc56217f3984 100644 (file)
@@ -329,7 +329,7 @@ static int ad7780_probe(struct spi_device *spi)
 
        ret = ad7780_init_gpios(&spi->dev, st);
        if (ret)
-               goto error_cleanup_buffer_and_trigger;
+               return ret;
 
        st->reg = devm_regulator_get(&spi->dev, "avdd");
        if (IS_ERR(st->reg))
This page took 0.054447 seconds and 4 git commands to generate.