提交 82f0efbc 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] tm6000: fix an uninitialized variable

tm6000_poll could use an uninitialized buf pointer. Move the buf-handling
code inside the 'if' that initializes the buf pointer.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 bf5bbed1
......@@ -1455,14 +1455,14 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait)
if (list_empty(&fh->vb_vidq.stream))
return res | POLLERR;
buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == VIDEOBUF_DONE ||
buf->vb.state == VIDEOBUF_ERROR)
return res | POLLIN | POLLRDNORM;
} else if (req_events & (POLLIN | POLLRDNORM)) {
/* read() capture */
return res | videobuf_poll_stream(file, &fh->vb_vidq, wait);
}
poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == VIDEOBUF_DONE ||
buf->vb.state == VIDEOBUF_ERROR)
return res | POLLIN | POLLRDNORM;
return res;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册