소스 검색

msm: camera: Correct the return logic for error case

Currently for the flush request error case, mutex unlock is
executed without mutex lock which result in instability of
system. This change returns with appropriate error code
if error occurs.

Change-Id: I2ff0056002c7d96a7100295f2ed6ba5cc0da2254
Signed-off-by: Jigarkumar Zala <[email protected]>
Jigarkumar Zala 6 년 전
부모
커밋
eedac0e21c
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      drivers/cam_req_mgr/cam_req_mgr_core.c

+ 2 - 4
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -3057,14 +3057,12 @@ int cam_req_mgr_flush_requests(
 
 	if (!flush_info) {
 		CAM_ERR(CAM_CRM, "flush req is NULL");
-		rc = -EFAULT;
-		goto end;
+		return -EFAULT;
 	}
 	if (flush_info->flush_type >= CAM_REQ_MGR_FLUSH_TYPE_MAX) {
 		CAM_ERR(CAM_CRM, "incorrect flush type %x",
 			flush_info->flush_type);
-		rc = -EINVAL;
-		goto end;
+		return -EINVAL;
 	}
 
 	mutex_lock(&g_crm_core_dev->crm_lock);