staging:iio:dac:ad5504 dereferencing just freed st in error path.
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 12 Aug 2011 15:55:33 +0000 (16:55 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 20:28:43 +0000 (13:28 -0700)
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>
drivers/staging/iio/dac/ad5504.c

index 1915f459868b304da85eb54c6d2e764721c9c11f..88512dd6450f3f5332e7164635621bd3973b56ed 100644 (file)
@@ -338,7 +338,7 @@ error_free_dev:
        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);