diff options
| author | Yigang Zheng <yigangz@codeaurora.org> | 2017-07-28 17:34:34 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-09-11 18:20:23 -0700 |
| commit | 0b925d013ebae4d69b79ed3f76ef916868fa895d (patch) | |
| tree | 40ca07574ac3ec32d8d6d45a053442e7220e5f0e | |
| parent | 1cbd1cdf8491634cca7f06812dbe8d1906033656 (diff) | |
msm: vidc: Avoid adding failed instance into list
Fix system crash bug when run multiple vidc instances
Change-Id: I7716854c210bf8d1191e2744e555d42f42e4a1f5
Signed-off-by: Yigang Zheng <yigangz@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/vidc/msm_vidc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c index 3677bb6e32e6..2eaae18bc2e9 100644 --- a/drivers/media/platform/msm/vidc/msm_vidc.c +++ b/drivers/media/platform/msm/vidc/msm_vidc.c @@ -1425,10 +1425,6 @@ void *msm_vidc_open(int core_id, int session_type) setup_event_queue(inst, &core->vdev[session_type].vdev); - mutex_lock(&core->lock); - list_add_tail(&inst->list, &core->instances); - mutex_unlock(&core->lock); - rc = msm_comm_try_state(inst, MSM_VIDC_CORE_INIT_DONE); if (rc) { dprintk(VIDC_ERR, @@ -1442,15 +1438,15 @@ void *msm_vidc_open(int core_id, int session_type) goto fail_init; } + mutex_lock(&core->lock); + list_add_tail(&inst->list, &core->instances); + mutex_unlock(&core->lock); + inst->debugfs_root = msm_vidc_debugfs_init_inst(inst, core->debugfs_root); return inst; fail_init: - mutex_lock(&core->lock); - list_del(&inst->list); - mutex_unlock(&core->lock); - v4l2_fh_del(&inst->event_handler); v4l2_fh_exit(&inst->event_handler); vb2_queue_release(&inst->bufq[OUTPUT_PORT].vb2_bufq); |
