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 <rpampana@codeaurora.org>
This commit is contained in:
Ravikishore Pampana 2021-03-27 14:32:34 +05:30
commit 4580f024fe

View file

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