From 7ef7162e36fdbc360c8b5bc027437e5a2b318258 Mon Sep 17 00:00:00 2001 From: Vikram Sharma Date: Thu, 25 Jan 2024 13:06:02 +0530 Subject: [PATCH] msm: camera: icp: Unlock mutex in case of ICP packet failure Mutex unlock is missing if the packet size is not equal to the packet header size during ICP packet validation. This commit add mutex unlock, which unlocks the mutex to handle the above scenario. CRs-Fixed: 3715702 Change-Id: Iafa94c1e6b3ee62cd7fd14ccfeb992c3c5c1c4c4 Signed-off-by: Vikram Sharma --- drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c index 8ba0fe0b37..ae547ec590 100644 --- a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +++ b/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -6181,8 +6181,10 @@ static int cam_icp_mgr_prepare_hw_update(void *hw_mgr_priv, packet = prepare_args->packet; - if (cam_packet_util_validate_packet(packet, prepare_args->remain_len)) + if (cam_packet_util_validate_packet(packet, prepare_args->remain_len)) { + mutex_unlock(&ctx_data->ctx_mutex); return -EINVAL; + } rc = cam_icp_mgr_pkt_validation(ctx_data, packet); if (rc) {