From 062e25047a799b2e3cd25f9da60bbb184d416aaa Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Mon, 2 Jul 2012 13:20:11 -0700 Subject: [PATCH] camera: Add missing mutex initialization. inst_lock of pcam_inst needs to be initialized and destroyed properly. Change-Id: Ie041fc429cdf122c01b93393bb4a6c20a08e4267 Signed-off-by: Shuzhen Wang --- drivers/media/video/msm/msm_mctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/video/msm/msm_mctl.c b/drivers/media/video/msm/msm_mctl.c index 0da5043f50c..be6c543bfeb 100644 --- a/drivers/media/video/msm/msm_mctl.c +++ b/drivers/media/video/msm/msm_mctl.c @@ -897,6 +897,7 @@ static int msm_mctl_dev_open(struct file *f) pcam_inst->sensor_pxlcode = pcam->usr_fmts[0].pxlcode; pcam_inst->my_index = i; pcam_inst->pcam = pcam; + mutex_init(&pcam_inst->inst_lock); pcam->mctl_node.dev_inst[i] = pcam_inst; D("%s pcam_inst %p my_index = %d\n", __func__, @@ -1006,6 +1007,7 @@ static int msm_mctl_dev_close(struct file *f) pcam->mctl_node.dev_inst[pcam_inst->my_index] = NULL; v4l2_fh_del(&pcam_inst->eventHandle); v4l2_fh_exit(&pcam_inst->eventHandle); + mutex_destroy(&pcam_inst->inst_lock); kfree(pcam_inst); if (NULL != pmctl) {