Linux IIO development
 help / color / mirror / Atom feed
* Re: [PATCH] drivers: staging: iio: adc: fix uninitialized use
       [not found] <1309657621-21711-1-git-send-email-chrisf@ijw.co.nz>
@ 2011-07-04  9:01 ` Jonathan Cameron
  2011-07-04  9:10   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2011-07-04  9:01 UTC (permalink / raw)
  To: Chris Forbes
  Cc: Greg Kroah-Hartman, devel, linux-kernel,
	linux-iio@vger.kernel.org

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;
>  }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: staging: iio: adc: fix uninitialized use
  2011-07-04  9:01 ` [PATCH] drivers: staging: iio: adc: fix uninitialized use Jonathan Cameron
@ 2011-07-04  9:10   ` Dan Carpenter
  2011-07-04  9:45     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2011-07-04  9:10 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Chris Forbes, devel, linux-iio@vger.kernel.org,
	Greg Kroah-Hartman, linux-kernel

On Mon, Jul 04, 2011 at 10:01:11AM +0100, Jonathan Cameron wrote:
> 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.

It would better to add an entry to MAINTAINERS so that
./scripts/get_maintainer.pl gave the right lists.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: staging: iio: adc: fix uninitialized use
  2011-07-04  9:10   ` Dan Carpenter
@ 2011-07-04  9:45     ` Jonathan Cameron
  2011-07-04 15:34       ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2011-07-04  9:45 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Forbes, devel, linux-iio@vger.kernel.org,
	Greg Kroah-Hartman, linux-kernel

On 07/04/11 10:10, Dan Carpenter wrote:
> On Mon, Jul 04, 2011 at 10:01:11AM +0100, Jonathan Cameron wrote:
>> 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.
> 
> It would better to add an entry to MAINTAINERS so that
> ./scripts/get_maintainer.pl gave the right lists.
Perhaps, but Greg KH is anti, so it isn't going to happen.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: staging: iio: adc: fix uninitialized use
  2011-07-04  9:45     ` Jonathan Cameron
@ 2011-07-04 15:34       ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2011-07-04 15:34 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Dan Carpenter, Chris Forbes, devel, linux-iio@vger.kernel.org,
	linux-kernel

On Mon, Jul 04, 2011 at 10:45:01AM +0100, Jonathan Cameron wrote:
> On 07/04/11 10:10, Dan Carpenter wrote:
> > On Mon, Jul 04, 2011 at 10:01:11AM +0100, Jonathan Cameron wrote:
> >> 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.
> > 
> > It would better to add an entry to MAINTAINERS so that
> > ./scripts/get_maintainer.pl gave the right lists.
> Perhaps, but Greg KH is anti, so it isn't going to happen.

I'm coming around on this, for larger chunks of code, like iio, I don't
mind it, so feel free to send me an entry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-04 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1309657621-21711-1-git-send-email-chrisf@ijw.co.nz>
2011-07-04  9:01 ` [PATCH] drivers: staging: iio: adc: fix uninitialized use Jonathan Cameron
2011-07-04  9:10   ` Dan Carpenter
2011-07-04  9:45     ` Jonathan Cameron
2011-07-04 15:34       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox