Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecf05f4f authored by Aditya Jonnalagadda's avatar Aditya Jonnalagadda Committed by Matt Wagantall
Browse files

msm: camera: avoid recursive mutex lock in cam_smmu_detach



Due to recursive mutex lock in cam_smmu_detach fucntion which
is leading to deadlock, add mutex unlock to avoid deadlock
situation.

Change-Id: If47ff3e16e2e981819193eea5680de55b58295e6
Signed-off-by: default avatarAditya Jonnalagadda <ajonnala@codeaurora.org>
parent 2e1b466d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -806,16 +806,17 @@ int cam_smmu_destroy_handle(int handle)
	mutex_lock(&iommu_cb_set.cb_info[idx].lock);
	if (iommu_cb_set.cb_info[idx].state == CAM_SMMU_ATTACH) {
		CDBG("It should get detached before.\n");
		mutex_unlock(&iommu_cb_set.cb_info[idx].lock);
		ret = cam_smmu_detach(idx);
		if (ret < 0) {
			pr_err("Error: Detach idx %d fail\n", idx);
			mutex_unlock(&iommu_cb_set.cb_info[idx].lock);
			mutex_unlock(&iommu_table_lock);
			return -EINVAL;
		}
	} else {
		mutex_unlock(&iommu_cb_set.cb_info[idx].lock);
	}

	mutex_unlock(&iommu_cb_set.cb_info[idx].lock);
	mutex_destroy(&iommu_cb_set.cb_info[idx].lock);
	mutex_unlock(&iommu_table_lock);
	return 0;