From 4580f024fed5cd208c1dab2470fa34dd149d5770 Mon Sep 17 00:00:00 2001 From: Ravikishore Pampana Date: Sat, 27 Mar 2021 14:32:34 +0530 Subject: [PATCH] msm: camera: req_mgr: Validate active sequence id in link control Validate active sequence id before clear bit. This avoid invalid clear bit scenario if link is created but try to deactivate with out link activate. CRs-Fixed: 2909190 Change-Id: Ie12f6bb100e1e12c41b9addf516446f4088ae8a3 Signed-off-by: Ravikishore Pampana --- drivers/cam_req_mgr/cam_req_mgr_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cam_req_mgr/cam_req_mgr_core.c b/drivers/cam_req_mgr/cam_req_mgr_core.c index 27c6e22b594b..3942655f58f9 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_core.c +++ b/drivers/cam_req_mgr/cam_req_mgr_core.c @@ -5001,7 +5001,10 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control) link->state = CAM_CRM_LINK_STATE_IDLE; link->skip_init_frame = false; crm_timer_exit(&link->watchdog); - clear_bit(link->activate_seq, g_crm_core_dev->bitmap); + if ((link->activate_seq >= 0) && + (link->activate_seq < MAXIMUM_LINKS_PER_SESSION)) + clear_bit(link->activate_seq, g_crm_core_dev->bitmap); + link->activate_seq = -1; spin_unlock_bh(&link->link_state_spin_lock); CAM_DBG(CAM_CRM,