diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2020-05-17 11:59:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-22 09:33:02 +0200 |
commit | a6fe5dde5343d429271f8ac5bf17875e6bc3463c (patch) | |
tree | 660fe482b0bed66ee5fdf418658e073db09efa6b | |
parent | 28be430bbf13084539c59feb12e8f0d33b044f99 (diff) | |
download | linux-stable-a6fe5dde5343d429271f8ac5bf17875e6bc3463c.tar.gz linux-stable-a6fe5dde5343d429271f8ac5bf17875e6bc3463c.tar.bz2 linux-stable-a6fe5dde5343d429271f8ac5bf17875e6bc3463c.zip |
iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
[ Upstream commit b0536f9826a5ed3328d527b4fc1686867a9f3041 ]
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 <christophe.jaillet@wanadoo.fr>
Acked-by: Renato Lui Geh <renatogeh@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/iio/adc/ad7780.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c index 217a5a5c3c6d..7e741294de7b 100644 --- a/drivers/iio/adc/ad7780.c +++ b/drivers/iio/adc/ad7780.c @@ -309,7 +309,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)) |