summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdulla Anam <abdullahanam@codeaurora.org>2017-05-10 20:45:22 +0530
committerAbdulla Anam <abdullahanam@codeaurora.org>2017-05-16 23:23:42 +0530
commit22d558528101ee8d921e8a14eebdb46d0feb4e41 (patch)
tree1633e3dbfb1aaa52409d7ecb543cbccc82d59760
parent75a9d0fee5b264c89afdc8b155848625fcbe9ca0 (diff)
msm: vidc: Call vb2_queue_release before destroying reg_buf lock
vb2_queue_release could call buf_cleanup which acquires registered _buf lock. Hence call queue release before destroying the lock. CRs-Fixed: 2044665 Change-Id: I512ba96eec91e484c885ad2ec3614b6348727e60 Signed-off-by: Abdulla Anam <abdullahanam@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/vidc/msm_vidc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index 644203b65999..b5fe26b0fc2b 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -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;
}