[PATCH 1/2] staging: dgnc: take lock when accessing to dgnc_poll_tick
Salah Triki
salah.triki at acm.org
Tue Sep 22 11:55:02 UTC 2015
On Mon, Sep 21, 2015 at 07:17:08PM +0300, Dan Carpenter wrote:
> On Sun, Sep 06, 2015 at 08:00:10PM -0700, Greg KH wrote:
> > On Sat, Sep 05, 2015 at 01:12:01PM +0100, Salah Triki wrote:
> > > poll_tick is declared global, so dgnc_driver_pollrate_* need to
> > > take the lock dgnc_poll_lock before accessing to this variable.
> >
> > Really? The scope of a variable doesn't matter if a lock is needed for
> > it or not.
> >
> > And this patch doesn't really do anything at all, I don't understand why
> > it is needed, please explain.
> >
>
> Salah has not replied. He didn't reply to the previous email, but he
> edited the changelog so maybe that was supposed to count as reply?
>
> Anyway, all the reads of dgnc_poll_tick are protected, it was only the
> write which wasn't. It could race. I think this patch is the right
> thing.
>
> regards,
> dan carpenter
>
I changed not only the changelog but also the function
dgnc_driver_pollrate_show. However, these changes are erroneous as mentioned
by Greg. So please ignore this patch and consider instead the patch
_[PATCH v3] staging: dgnc: take lock when storing value in dgnc_poll_tick_.
best regards,
salah triki
More information about the devel
mailing list