diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-02-07 06:49:48 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-18 14:48:37 -0500 |
commit | c6f5c7c237fb7179f3652a46108086c9178eb419 (patch) | |
tree | b6c138f3085bc2d0fd1a32b7543601423a58e277 /drivers/media/dvb-core/dvb_ca_en50221.c | |
parent | bb436cbeb918740638278217c241d81a306c1bc3 (diff) |
media: dvb-core: 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 dvb_demux_poll(), dvb_dvr_poll() and
dvb_ca_en50221_io_poll(). Fix this, otherwise epoll()
can 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/dvb-core/dvb_ca_en50221.c')
-rw-r--r-- | drivers/media/dvb-core/dvb_ca_en50221.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index 4d371cea0d5d..ebf1e3b03819 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1797,6 +1797,8 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait) dprintk("%s\n", __func__); + poll_wait(file, &ca->wait_queue, wait); + if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) mask |= EPOLLIN; @@ -1804,9 +1806,6 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait) if (mask) return mask; - /* wait for something to happen */ - poll_wait(file, &ca->wait_queue, wait); - if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) mask |= EPOLLIN; |