diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-02-07 12:49:41 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-18 20:44:45 +0100 |
commit | b7990bcfb644c53511cca97dca6e39d1bd70732a (patch) | |
tree | e50ff50bd158b9576b577ed05c57951926248429 /drivers/media/cec | |
parent | media: vb2: keep track of timestamp status (diff) | |
download | linux-b7990bcfb644c53511cca97dca6e39d1bd70732a.tar.xz linux-b7990bcfb644c53511cca97dca6e39d1bd70732a.zip |
media: cec: fix epoll() by calling poll_wait first
The epoll function expects that whenever the poll file op is
called, the poll_wait function is also called. That didn't
always happen in cec_poll(). Fix this, otherwise epoll()
would timeout when it shouldn't.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/cec')
-rw-r--r-- | drivers/media/cec/cec-api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c index 391b6fd483e1..156a0d76ab2a 100644 --- a/drivers/media/cec/cec-api.c +++ b/drivers/media/cec/cec-api.c @@ -38,6 +38,7 @@ static __poll_t cec_poll(struct file *filp, struct cec_adapter *adap = fh->adap; __poll_t res = 0; + poll_wait(filp, &fh->wait, poll); if (!cec_is_registered(adap)) return EPOLLERR | EPOLLHUP; mutex_lock(&adap->lock); @@ -48,7 +49,6 @@ static __poll_t cec_poll(struct file *filp, res |= EPOLLIN | EPOLLRDNORM; if (fh->total_queued_events) res |= EPOLLPRI; - poll_wait(filp, &fh->wait, poll); mutex_unlock(&adap->lock); return res; } |