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 <quic_eung@quicinc.com>
このコミットが含まれているのは:
Sokchetra Eung
2023-01-20 09:56:02 -08:00
committed by Camera Software Integration
コミット 274dfda605

ファイルの表示

@@ -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;