summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-03-06 22:43:36 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-06 22:43:36 -0800
commitf35c117cc0ec07864bea85fbfaf5f9479440c4cd (patch)
treef8c3b0147865e3be228583346b27f4e9fdac05ac /drivers/media
parent4ce3eaf87702c1211d7e79f2e4f56f32b3eec8fd (diff)
parent2bc5c937f37d5a6ba76d4eb32e370f10df9d1ac5 (diff)
Merge "msm:cci: Add protection for race condition in cci queue access"
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
index 12d5d7eeb368..48872334cd83 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1284,6 +1284,10 @@ static int32_t msm_cci_init(struct v4l2_subdev *sd,
CDBG("%s:%d master %d\n", __func__, __LINE__, master);
if (master < MASTER_MAX && master >= 0) {
mutex_lock(&cci_dev->cci_master_info[master].mutex);
+ mutex_lock(&cci_dev->cci_master_info[master].
+ mutex_q[PRIORITY_QUEUE]);
+ mutex_lock(&cci_dev->cci_master_info[master].
+ mutex_q[SYNC_QUEUE]);
flush_workqueue(cci_dev->write_wq[master]);
/* Re-initialize the completion */
reinit_completion(&cci_dev->
@@ -1308,6 +1312,10 @@ static int32_t msm_cci_init(struct v4l2_subdev *sd,
if (rc <= 0)
pr_err("%s:%d wait failed %d\n", __func__,
__LINE__, rc);
+ mutex_unlock(&cci_dev->cci_master_info[master].
+ mutex_q[SYNC_QUEUE]);
+ mutex_unlock(&cci_dev->cci_master_info[master].
+ mutex_q[PRIORITY_QUEUE]);
mutex_unlock(&cci_dev->cci_master_info[master].mutex);
}
return 0;