lkml.org 
[lkml]   [2013]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/2] media: rc: Add user count to rc dev.
On 19/07/13 12:01, Sean Young wrote:

>> + int rval = 0;
>>
>> - return rdev->open(rdev);
>> + if (!rdev->users++)
>> + rval = rdev->open(rdev);
>> +
>> + if (rval)
>> + rdev->users--;
>> +
>> + return rval;
>
> This looks racey. Some locking is needed, I think rc_dev->lock should work
> fine for this. Here and in the lirc code path too.
thanks Sean,
It makes sense, will fix this in v2.


Srini

>
> Sean
>
>> }
>


\
 
 \ /
  Last update: 2013-07-19 13:21    [W:0.036 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site