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: Karthikeyan Periasamy <kperiasa@codeaurora.org>
This commit is contained in:
Karthikeyan Periasamy 2016-11-15 18:00:02 -08:00
parent 4a1e5a36de
commit b8a19f3eee
2 changed files with 6 additions and 6 deletions

View file

@ -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);

View file

@ -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);