Эх сурвалжийг харах

msm: camera: icp: free device mem upon error

If icp hw type is invalid, free device memory allocation before
returning error code.

CRs-Fixed: 3385771
Change-Id: Ice9f533ead58d71aa5337ea57d85cfa97c898a2f
Signed-off-by: Sokchetra Eung <[email protected]>
Sokchetra Eung 2 жил өмнө
parent
commit
274dfda605

+ 2 - 1
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -7309,7 +7309,8 @@ static int cam_icp_mgr_alloc_devs(struct device_node *np,
 	if (!CAM_ICP_IS_VALID_HW_DEV_TYPE(icp_hw_type)) {
 		CAM_ERR(CAM_ICP, "[%s] Invalid hw dev type: %u",
 			hw_mgr->hw_mgr_name, icp_hw_type);
-		return -EINVAL;
+		rc = -EINVAL;
+		goto free_devs;
 	}
 
 	hw_mgr->devices[icp_hw_type] = devices;