staging:iio:dac:ad5504 dereferencing just freed st in error path.

Introduced when I did the iio_chan_spec conversion. Detected by smatch.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jonathan Cameron 2011-08-12 16:55:33 +01:00 committed by Greg Kroah-Hartman
parent 8df322385a
commit 0cbb2b53fb

View file

@ -338,7 +338,7 @@ static int __devinit ad5504_probe(struct spi_device *spi)
iio_free_device(indio_dev);
error_disable_reg:
if (!IS_ERR(reg))
regulator_disable(st->reg);
regulator_disable(reg);
error_put_reg:
if (!IS_ERR(reg))
regulator_put(reg);