diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-02-07 06:49:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-18 14:45:33 -0500 |
commit | f4dd471b5c368c396e8e03a65fec64bced949639 (patch) | |
tree | 53cb9ad93ac728b8df0f4a128b1247b4f594aa3d /drivers/media | |
parent | b7990bcfb644c53511cca97dca6e39d1bd70732a (diff) | |
download | linux-stable-f4dd471b5c368c396e8e03a65fec64bced949639.tar.gz linux-stable-f4dd471b5c368c396e8e03a65fec64bced949639.tar.bz2 linux-stable-f4dd471b5c368c396e8e03a65fec64bced949639.zip |
media: media-request: 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 media_request_poll(). Fix this, otherwise
epoll() would timeout when it shouldn't.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/media-request.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/media-request.c b/drivers/media/media-request.c index c71a34ae6383..eec2e2b2f6ec 100644 --- a/drivers/media/media-request.c +++ b/drivers/media/media-request.c @@ -100,6 +100,7 @@ static __poll_t media_request_poll(struct file *filp, if (!(poll_requested_events(wait) & EPOLLPRI)) return 0; + poll_wait(filp, &req->poll_wait, wait); spin_lock_irqsave(&req->lock, flags); if (req->state == MEDIA_REQUEST_STATE_COMPLETE) { ret = EPOLLPRI; @@ -110,8 +111,6 @@ static __poll_t media_request_poll(struct file *filp, goto unlock; } - poll_wait(filp, &req->poll_wait, wait); - unlock: spin_unlock_irqrestore(&req->lock, flags); return ret; |