LinuxTV Patchwork [RFC,6/8] v4l2-mem2mem: add q->error check to v4l2_m2m_poll()

login
register
mail settings
Submitter Hans Verkuil
Date Feb. 7, 2019, 11:49 a.m.
Message ID <20190207114948.37750-7-hverkuil-cisco@xs4all.nl>
Download mbox | patch
Permalink /patch/54369/
State Accepted
Delegated to: Hans Verkuil
Headers show

Comments

Hans Verkuil - Feb. 7, 2019, 11:49 a.m.
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

The v4l2_m2m_poll function didn't check whether q->error
was set for either of the two queues. Add support for this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/v4l2-core/v4l2-mem2mem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index d97781b8ff88..d2da5249b61b 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -638,8 +638,10 @@  __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 	 * means either in driver already or waiting for driver to claim it
 	 * and start processing.
 	 */
-	if ((!src_q->streaming || list_empty(&src_q->queued_list))
-		&& (!dst_q->streaming || list_empty(&dst_q->queued_list))) {
+	if ((!src_q->streaming || src_q->error ||
+	     list_empty(&src_q->queued_list)) &&
+	    (!dst_q->streaming || dst_q->error ||
+	     list_empty(&dst_q->queued_list))) {
 		rc |= EPOLLERR;
 		goto end;
 	}

Privacy Policy