iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 17 May 2020 09:59:53 +0000 (11:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:08 +0000 (09:34 +0200)
commit873e48c465649c04993d063beddc6472967da4ff
treee70ec9486f089f264da58ac4bfbb174f91d47f3f
parent20dac5a3eb4befab22cf3f4cf5f6d3fefe2de8ab
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>
drivers/iio/adc/ad7780.c