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

Commit b8a19f3e authored by Karthikeyan Periasamy's avatar Karthikeyan Periasamy
Browse files

msm: vidc: fix mutex lock issue



vb2_queue_release uses mutex lock. So, the locks should be
destroyed at the end.

Change-Id: I8043a13d366fcb20a8a819c4739177258ad508ac
CRs-Fixed: 1086284
Signed-off-by: default avatarKarthikeyan Periasamy <kperiasa@codeaurora.org>
parent 4a1e5a36
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1324,11 +1324,6 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)

	msm_comm_ctrl_deinit(inst);

	mutex_destroy(&inst->sync_lock);
	mutex_destroy(&inst->bufq[CAPTURE_PORT].lock);
	mutex_destroy(&inst->bufq[OUTPUT_PORT].lock);
	mutex_destroy(&inst->lock);

	DEINIT_MSM_VIDC_LIST(&inst->pendingq);
	DEINIT_MSM_VIDC_LIST(&inst->scratchbufs);
	DEINIT_MSM_VIDC_LIST(&inst->persistbufs);
@@ -1342,6 +1337,11 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)
	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);
	mutex_destroy(&inst->lock);

	pr_info(VIDC_DBG_TAG "Closed video instance: %pK\n",
			VIDC_MSG_PRIO2STRING(VIDC_INFO), inst);
	kfree(inst);
+1 −1
Original line number Diff line number Diff line
@@ -1666,7 +1666,7 @@ static void handle_sys_error(enum hal_command_response cmd, void *data)
	 */

	mutex_lock(&core->lock);
	inst = list_first_entry(&core->instances,
	inst = list_first_entry_or_null(&core->instances,
		struct msm_vidc_inst, list);
	mutex_unlock(&core->lock);