aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-event.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-event.c')
-rw-r--r--drivers/media/video/v4l2-event.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index de74ce07b5e2..69fd343d4774 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -134,15 +134,22 @@ int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event,
134 if (nonblocking) 134 if (nonblocking)
135 return __v4l2_event_dequeue(fh, event); 135 return __v4l2_event_dequeue(fh, event);
136 136
137 /* Release the vdev lock while waiting */
138 if (fh->vdev->lock)
139 mutex_unlock(fh->vdev->lock);
140
137 do { 141 do {
138 ret = wait_event_interruptible(events->wait, 142 ret = wait_event_interruptible(events->wait,
139 events->navailable != 0); 143 events->navailable != 0);
140 if (ret < 0) 144 if (ret < 0)
141 return ret; 145 break;
142 146
143 ret = __v4l2_event_dequeue(fh, event); 147 ret = __v4l2_event_dequeue(fh, event);
144 } while (ret == -ENOENT); 148 } while (ret == -ENOENT);
145 149
150 if (fh->vdev->lock)
151 mutex_lock(fh->vdev->lock);
152
146 return ret; 153 return ret;
147} 154}
148EXPORT_SYMBOL_GPL(v4l2_event_dequeue); 155EXPORT_SYMBOL_GPL(v4l2_event_dequeue);