lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 1 Feb 2014 15:49:39 +0100
From:	Johannes Thumshirn <morbidrsa@...il.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	Jonathan Cameron <jic23@...nel.org>,
	Sachin Kamat <sachin.kamat@...aro.org>,
	Peter Meerwald <pmeerw@...erw.net>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: viperboard: Call platform_set_drvdata before
 devm_iio_device_register

On Sat, Feb 01, 2014 at 03:46:05PM +0100, Lars-Peter Clausen wrote:
> On 02/01/2014 03:39 PM, Johannes Thumshirn wrote:
> > Call platform_set_drvdata before devm_iio_device_register to avoid possible
> > race condition when accessing driver data.
>
> I don't think the driver data is accessed from within any of the IIO device
> callbacks. In fact I don't think it is accessed at all with the latest
> conversion to devm_iio_device_register(). So I think the call to
> platform_set_drvdata can just be removed.
>
> >
> > Signed-off-by: Johannes Thumshirn <morbidrsa@...il.com>
> > ---
> >  drivers/iio/adc/viperboard_adc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/adc/viperboard_adc.c b/drivers/iio/adc/viperboard_adc.c
> > index d0add8f..7d9bd05 100644
> > --- a/drivers/iio/adc/viperboard_adc.c
> > +++ b/drivers/iio/adc/viperboard_adc.c
> > @@ -133,14 +133,14 @@ static int vprbrd_adc_probe(struct platform_device *pdev)
> >  	indio_dev->channels = vprbrd_adc_iio_channels;
> >  	indio_dev->num_channels = ARRAY_SIZE(vprbrd_adc_iio_channels);
> >
> > +	platform_set_drvdata(pdev, indio_dev);
> > +
> >  	ret = devm_iio_device_register(&pdev->dev, indio_dev);
> >  	if (ret) {
> >  		dev_err(&pdev->dev, "could not register iio (adc)");
> >  		return ret;
> >  	}
> >
> > -	platform_set_drvdata(pdev, indio_dev);
> > -
> >  	return 0;
> >  }
> >
> >
>

Looks like you're right. So we can drop this patch and I'll make a remove version.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ