Re: [PATCH 1/2] staging: dgnc: take lock when accessing to dgnc_poll_tick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux