From: Jonathan Cameron <jic23@cam.ac.uk>
To: Chris Forbes <chrisf@ijw.co.nz>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] drivers: staging: iio: adc: fix uninitialized use
Date: Mon, 04 Jul 2011 10:01:11 +0100 [thread overview]
Message-ID: <4E118157.3020906@cam.ac.uk> (raw)
In-Reply-To: <1309657621-21711-1-git-send-email-chrisf@ijw.co.nz>
On 07/03/11 02:47, Chris Forbes wrote:
> Fixed an uninitialized variable access. In the first two error paths in
> max1363_probe(), 'st' is not yet initialized, but its 'reg' member is
> accessed anyway. This would most likely crash.
Good spot. Please tech TODO files for staging patches. In this case it would
have given you the mailing list, now cc'd.
>
> The intended value for st->reg *is* available at that point in 'reg',
> so just use that directly.
>
> Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
> drivers/staging/iio/adc/max1363_core.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> index 98cebd2..ebecf14 100644
> --- a/drivers/staging/iio/adc/max1363_core.c
> +++ b/drivers/staging/iio/adc/max1363_core.c
> @@ -1335,11 +1335,11 @@ error_free_device:
> else
> iio_device_unregister(indio_dev);
> error_disable_reg:
> - if (!IS_ERR(st->reg))
> - regulator_disable(st->reg);
> + if (!IS_ERR(reg))
> + regulator_disable(reg);
> error_put_reg:
> - if (!IS_ERR(st->reg))
> - regulator_put(st->reg);
> + if (!IS_ERR(reg))
> + regulator_put(reg);
>
> return ret;
> }
next parent reply other threads:[~2011-07-04 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1309657621-21711-1-git-send-email-chrisf@ijw.co.nz>
2011-07-04 9:01 ` Jonathan Cameron [this message]
2011-07-04 9:10 ` [PATCH] drivers: staging: iio: adc: fix uninitialized use Dan Carpenter
2011-07-04 9:45 ` Jonathan Cameron
2011-07-04 15:34 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E118157.3020906@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=chrisf@ijw.co.nz \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox