All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
@ 2020-05-17  9:59 ` Christophe JAILLET
  0 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2020-05-17  9:59 UTC (permalink / raw)
  To: Michael.Hennerich, renatogeh, lars, jic23, knaack.h, pmeerw,
	giuliano.belinassi
  Cc: linux-iio, linux-kernel, kernel-janitors, Christophe JAILLET

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>
---
 drivers/iio/adc/ad7780.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c
index f47606ebbbbe..b33fe6c3907e 100644
--- a/drivers/iio/adc/ad7780.c
+++ b/drivers/iio/adc/ad7780.c
@@ -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))
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-05 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-17  9:59 [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' Christophe JAILLET
2020-05-17  9:59 ` Christophe JAILLET
2020-05-18  2:21 ` Renato Lui Geh
2020-05-18  2:21   ` Renato Lui Geh
2020-07-05 11:59   ` Jonathan Cameron
2020-07-05 11:59     ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.