From: Jonathan Cameron Date: Fri, 12 Aug 2011 15:55:33 +0000 (+0100) Subject: staging:iio:dac:ad5504 dereferencing just freed st in error path. X-Git-Tag: firefly_0821_release~3680^2~4313^2^2~864^2~254 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0cbb2b53fb57b002d0511226f3ad001569be9c66;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c index 1915f459868b..88512dd6450f 100644 --- a/drivers/staging/iio/dac/ad5504.c +++ b/drivers/staging/iio/dac/ad5504.c @@ -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);