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

Commit cad5db35 authored by Surajit Podder's avatar Surajit Podder Committed by Shivendra Kakrania
Browse files

msm_vidc: Clear pendingq when releasing buffers



Clear pendingq when releasing buffers to ensure
that invalid buffers are not accessed when new
buffers are queued.

CRs-Fixed: 1109306
Change-Id: I7ce2babe8bcc25b2582e92f04fc4233a6cfc8ef1
Signed-off-by: default avatarSurajit Podder <spodder@codeaurora.org>
Signed-off-by: default avatarShivendra Kakrania <shiven@codeaurora.org>
parent 5915565f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -878,6 +878,7 @@ int msm_vidc_release_buffer(void *instance, int buffer_type,
	struct buffer_info *bi, *dummy;
	int i, rc = 0;
	int found_buf = 0;
	struct vb2_buf_entry *temp, *next;

	if (!inst)
		return -EINVAL;
@@ -936,6 +937,16 @@ int msm_vidc_release_buffer(void *instance, int buffer_type,
	default:
		break;
	}

	mutex_lock(&inst->pendingq.lock);
	list_for_each_entry_safe(temp, next, &inst->pendingq.list, list) {
		if (temp->vb->type == buffer_type) {
			list_del(&temp->list);
			kfree(temp);
		}
	}
	mutex_unlock(&inst->pendingq.lock);

	return rc;
}
EXPORT_SYMBOL(msm_vidc_release_buffer);