public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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;
>  }


  reply	other threads:[~2011-07-04  8:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-03  1:47 [PATCH] drivers: staging: iio: adc: fix uninitialized use Chris Forbes
2011-07-04  9:01 ` Jonathan Cameron [this message]
2011-07-04  9:10   ` Dan Carpenter
2011-07-04  9:45     ` Jonathan Cameron
2011-07-04 15:34       ` Greg KH
2011-07-05 16:42         ` [PATCH 00/14] MAINTAINERS: Add staging Joe Perches
2011-07-05 16:42           ` [PATCH 01/14] MAINTAINERS: Add STAGING - ASUS OLED Joe Perches
2011-07-05 16:42           ` [PATCH 02/14] MAINTAINERS: Add STAGING - COMEDI Joe Perches
2011-07-05 16:42           ` [PATCH 03/14] MAINTAINERS: Add STAGING - CRYSTAL HD VIDEO DECODER Joe Perches
2011-07-05 16:42           ` [PATCH 04/14] MAINTAINERS: Add STAGING - ECHO CANCELLER Joe Perches
2011-07-05 16:42           ` [PATCH 05/14] MAINTAINERS: Add STAGING - FRONTIER TRANZPORT AND ALPHATRACK Joe Perches
2011-07-05 16:42           ` [PATCH 06/14] MAINTAINERS: Add STAGING - HYPER-V (MICROSOFT) Joe Perches
2011-07-05 16:42           ` [PATCH 07/14] MAINTAINERS: Add STAGING - INDUSTRIAL IO Joe Perches
2011-07-05 16:42           ` [PATCH 08/14] MAINTAINERS: Add STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER Joe Perches
2011-07-05 16:42           ` [PATCH 09/14] MAINTAINERS: Add STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER Joe Perches
2011-07-05 16:42           ` [PATCH 10/14] MAINTAINERS: Add STAGING - VIA VT665X DRIVERS Joe Perches
2011-07-05 16:42           ` [PATCH 11/14] MAINTAINERS: Add STAGING - WINBOND IS89C35 WLAN USB DRIVER Joe Perches
2011-07-05 16:42           ` [PATCH 12/14] MAINTAINERS: Add STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS Joe Perches
2011-07-05 16:42           ` [PATCH 13/14] MAINTAINERS: Add STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER Joe Perches
2011-07-05 16:42           ` [PATCH 14/14] MAINTAINERS: Remove se401 entry Joe Perches
2011-07-05 16:54           ` [PATCH 00/14] MAINTAINERS: Add staging Greg KH
2011-07-06  3:36 ` [PATCH] drivers: staging: iio: adc: fix uninitialized use Greg KH
2011-07-06  3:57   ` Chris Forbes
2011-07-06  4:01     ` 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