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

This commit is contained in:
Linux Build Service Account 2017-06-05 04:34:41 -07:00 committed by Gerrit - the friendly Code Review server
commit fdc3087c00

View file

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