Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03588e64 authored by Srinu Gorle's avatar Srinu Gorle
Browse files

msm: vidc: verify vb2 buffer state before returning to V4L2 framework



When two or more buffers in the vb2 queue point to the same address,
the wrong vb2_buffer has been populated.
Verify vb2_buffer state before populating from list.

Change-Id: If8c875cfb8bd0f33102b23e9c6f7d8e14c033137
CRs-Fixed: 637379
Signed-off-by: default avatarSrinu Gorle <sgorle@codeaurora.org>
parent 24bb7c34
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1150,7 +1150,8 @@ static struct vb2_buffer *get_vb_from_device_addr(struct buf_queue *bufq,
	q = &bufq->vb2_bufq;
	mutex_lock(&bufq->lock);
	list_for_each_entry(vb, &q->queued_list, queued_entry) {
		if (vb->v4l2_planes[0].m.userptr == dev_addr) {
		if (vb->v4l2_planes[0].m.userptr == dev_addr &&
			vb->state == VB2_BUF_STATE_ACTIVE) {
			found = 1;
			dprintk(VIDC_DBG, "Found v4l2_buf index : %d\n",
					vb->v4l2_buf.index);