Преглед на файлове

msm: camera: sensor: Fix mutex handling in TPG driver

Issue:
TPG driver doesn't release the device mutex when the stop/
configure commands fail.

Fix:
Release the mutex everytime it's acquired in TPG driver.

Change-Id: I8414c73b89e1e69b60682d860ec1d97d6a7a8dbc
CRs-Fixed: 3594995
Signed-off-by: Shravan Nevatia <[email protected]>
(cherry picked from commit 7b9602e996781f36a79c514780d1f776f5dfda8a)
Shravan Nevatia преди 1 година
родител
ревизия
ed308a3020
променени са 1 файла, в които са добавени 4 реда и са изтрити 6 реда
  1. 4 6
      drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c

+ 4 - 6
drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c

@@ -830,14 +830,14 @@ int tpg_hw_stop(struct tpg_hw *hw)
 			if (rc) {
 				CAM_ERR(CAM_TPG, "TPG[%d] hw stop failed %d",
 					hw->hw_idx, rc);
-				return rc;
+				break;
 			}
 		}
 		rc = tpg_hw_soc_disable(hw);
 		if (rc) {
 			CAM_ERR(CAM_TPG, "TPG[%d] hw soc disable failed %d",
 				hw->hw_idx, rc);
-			return rc;
+			break;
 		}
 		tpg_hw_free_waiting_requests_locked(hw);
 		tpg_hw_free_active_requests_locked(hw);
@@ -966,7 +966,7 @@ static int tpg_hw_configure_init_settings(
 		if (rc) {
 			CAM_ERR(CAM_TPG, "TPG[%d] hw soc enable failed %d",
 				hw->hw_idx, rc);
-			return rc;
+			break;
 		}
 
 		if (hw->hw_info->ops->init)
@@ -975,7 +975,6 @@ static int tpg_hw_configure_init_settings(
 		if (rc) {
 			CAM_ERR(CAM_TPG, "TPG[%d] hw init failed %d",
 				hw->hw_idx, rc);
-			return rc;
 		}
 		break;
 	default:
@@ -1011,7 +1010,7 @@ static int tpg_hw_configure_init_settings_v3(
 		if (rc) {
 			CAM_ERR(CAM_TPG, "TPG[%d] hw soc enable failed %d",
 				hw->hw_idx, rc);
-			return rc;
+			break;
 		}
 
 		if (hw->hw_info->ops->init)
@@ -1020,7 +1019,6 @@ static int tpg_hw_configure_init_settings_v3(
 		if (rc) {
 			CAM_ERR(CAM_TPG, "TPG[%d] hw init failed %d",
 				hw->hw_idx, rc);
-			return rc;
 		}
 		break;
 	default: