@@ -665,6 +665,7 @@ int videobuf_dqbuf(struct videobuf_queue *q,
{
struct videobuf_buffer *buf = NULL;
int retval;
+ int err_flag = 0;
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
@@ -679,7 +680,7 @@ int videobuf_dqbuf(struct videobuf_queue *q,
switch (buf->state) {
case VIDEOBUF_ERROR:
dprintk(1, "dqbuf: state is error\n");
- retval = -EIO;
+ err_flag = V4L2_BUF_FLAG_ERROR;
CALL(q, sync, q, buf);
buf->state = VIDEOBUF_IDLE;
break;
@@ -696,6 +697,7 @@ int videobuf_dqbuf(struct videobuf_queue *q,
list_del(&buf->stream);
memset(b, 0, sizeof(*b));
videobuf_status(q, b, buf, q->type);
+ b->flags |= err_flag;
done:
mutex_unlock(&q->vb_lock);
return retval;