Skip to content

Commit b0536f9

Browse files
tititiou36jic23
authored andcommitted
iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
If 'ad7780_init_gpios()' fails, we must not release some resources that have not been allocated yet. Return directly instead. Fixes: 5bb30e7 ("staging: iio: ad7780: move regulator to after GPIO init") Fixes: 9085daa ("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]>
1 parent 8db4afe commit b0536f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/ad7780.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int ad7780_probe(struct spi_device *spi)
329329

330330
ret = ad7780_init_gpios(&spi->dev, st);
331331
if (ret)
332-
goto error_cleanup_buffer_and_trigger;
332+
return ret;
333333

334334
st->reg = devm_regulator_get(&spi->dev, "avdd");
335335
if (IS_ERR(st->reg))

0 commit comments

Comments
 (0)