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

Commit fdc3087c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Call vb2_queue_release before destroying reg_buf lock"

parents 03e51c16 22d55852
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1362,7 +1362,6 @@ static void cleanup_instance(struct msm_vidc_inst *inst)
int msm_vidc_destroy(struct msm_vidc_inst *inst)
{
	struct msm_vidc_core *core;
	int i = 0;

	if (!inst || !inst->core)
		return -EINVAL;
@@ -1386,9 +1385,6 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)
	v4l2_fh_del(&inst->event_handler);
	v4l2_fh_exit(&inst->event_handler);

	for (i = 0; i < MAX_PORT_NUM; i++)
		vb2_queue_release(&inst->bufq[i].vb2_bufq);

	mutex_destroy(&inst->sync_lock);
	mutex_destroy(&inst->bufq[CAPTURE_PORT].lock);
	mutex_destroy(&inst->bufq[OUTPUT_PORT].lock);
@@ -1412,7 +1408,7 @@ int msm_vidc_close(void *instance)

	struct msm_vidc_inst *inst = instance;
	struct buffer_info *bi, *dummy;
	int rc = 0;
	int rc = 0, i = 0;

	if (!inst || !inst->core)
		return -EINVAL;
@@ -1449,6 +1445,12 @@ int msm_vidc_close(void *instance)
	msm_comm_session_clean(inst);
	msm_smem_delete_client(inst->mem_client);

	for (i = 0; i < MAX_PORT_NUM; i++) {
		mutex_lock(&inst->bufq[i].lock);
		vb2_queue_release(&inst->bufq[i].vb2_bufq);
		mutex_unlock(&inst->bufq[i].lock);
	}

	kref_put(&inst->kref, close_helper);
	return 0;
}