mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
media: cec-core: first mark device unregistered, then wake up fhs
If a CEC device node is unregistered, then it should be marked as unregistered before waking up any filehandles that are waiting for an event. This ensures that there is no race condition where an application can call CEC_DQEVENT and have the ioctl return 0 instead of ENODEV. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
01c7a8167d
commit
e91c255733
1 changed files with 2 additions and 2 deletions
|
@ -166,12 +166,12 @@ static void cec_devnode_unregister(struct cec_adapter *adap)
|
|||
mutex_unlock(&devnode->lock);
|
||||
return;
|
||||
}
|
||||
devnode->registered = false;
|
||||
devnode->unregistered = true;
|
||||
|
||||
list_for_each_entry(fh, &devnode->fhs, list)
|
||||
wake_up_interruptible(&fh->wait);
|
||||
|
||||
devnode->registered = false;
|
||||
devnode->unregistered = true;
|
||||
mutex_unlock(&devnode->lock);
|
||||
|
||||
mutex_lock(&adap->lock);
|
||||
|
|
Loading…
Reference in a new issue