* [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
@ 2020-05-17 9:59 Christophe JAILLET
2020-05-18 2:21 ` Renato Lui Geh
0 siblings, 1 reply; 3+ 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] 3+ messages in thread
* Re: [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
2020-05-17 9:59 [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' Christophe JAILLET
@ 2020-05-18 2:21 ` Renato Lui Geh
2020-07-05 11:59 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Renato Lui Geh @ 2020-05-18 2:21 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Michael.Hennerich, renatogeh, lars, jic23, knaack.h, pmeerw,
giuliano.belinassi, linux-iio, linux-kernel, kernel-janitors
Acked-by: Renato Lui Geh <renatogeh@gmail.com>
On 05/17, Christophe JAILLET wrote:
>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 [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
2020-05-18 2:21 ` Renato Lui Geh
@ 2020-07-05 11:59 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2020-07-05 11:59 UTC (permalink / raw)
To: Renato Lui Geh
Cc: Christophe JAILLET, Michael.Hennerich, lars, knaack.h, pmeerw,
giuliano.belinassi, linux-iio, linux-kernel, kernel-janitors
On Sun, 17 May 2020 23:21:29 -0300
Renato Lui Geh <renatogeh@gmail.com> wrote:
> Acked-by: Renato Lui Geh <renatogeh@gmail.com>
>
> On 05/17, Christophe JAILLET wrote:
> >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>
Applied to the fixes-togreg branch of iio.git.
Thanks,
Jonathan
> >---
> > 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 [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-05 11:59 UTC | newest]
Thread overview: 3+ 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-18 2:21 ` Renato Lui Geh
2020-07-05 11:59 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).