From 033864b04f4baf6eec4f1e1b3e87da024f55e9e8 Mon Sep 17 00:00:00 2001 From: Fernando Pacheco Date: Thu, 17 Sep 2020 16:38:35 -0700 Subject: [PATCH] msm: camera: icp: Fix potential deadlock scenario in cam_hfi_init Make sure we perform the necessary unlock operations before we return on an invalid HFI state. CRs-Fixed: 2783934 Change-Id: I7c611fb98d245952f2f4e9a57dc5fcb249572a40 Signed-off-by: Fernando Pacheco --- drivers/cam_icp/hfi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cam_icp/hfi.c b/drivers/cam_icp/hfi.c index 2cc4e53b52..9b9ea4bfc7 100644 --- a/drivers/cam_icp/hfi.c +++ b/drivers/cam_icp/hfi.c @@ -647,7 +647,8 @@ int cam_hfi_init(struct hfi_mem_info *hfi_mem, const struct hfi_ops *hfi_ops, if (g_hfi->hfi_state != HFI_DEINIT) { CAM_ERR(CAM_HFI, "hfi_init: invalid state"); - return -EINVAL; + rc = -EINVAL; + goto regions_fail; } memcpy(&g_hfi->map, hfi_mem, sizeof(g_hfi->map));