Re: [PATCH v1 1/2] media: rc: Add user count to rc dev.

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

 



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
> 
>>  }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux