فهرست منبع

msm: camera: reqmgr: Fix timing issue while destroying the session

During destroying the session, sof freeze timeout happens
after destroying workqueue. Then sof freeze timeout callback
will access workqueue causing use after free memory issue.
This change invokes destroying timer prior to workqueue.

CRs-Fixed: 2807936
Change-Id: I1f0dcb7a03fbf802f4ec872727e3b627a78f56f8
Signed-off-by: zhuo <[email protected]>
zhuo 4 سال پیش
والد
کامیت
ee8e8ee884
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      drivers/cam_req_mgr/cam_req_mgr_core.c

+ 2 - 2
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -3559,12 +3559,12 @@ static int __cam_req_mgr_unlink(struct cam_req_mgr_core_link *link)
 
 
 	mutex_lock(&link->lock);
 	mutex_lock(&link->lock);
 
 
-	/* Destroy workq of link */
-	cam_req_mgr_workq_destroy(&link->workq);
 	spin_lock_bh(&link->link_state_spin_lock);
 	spin_lock_bh(&link->link_state_spin_lock);
 	/* Destroy timer of link */
 	/* Destroy timer of link */
 	crm_timer_exit(&link->watchdog);
 	crm_timer_exit(&link->watchdog);
 	spin_unlock_bh(&link->link_state_spin_lock);
 	spin_unlock_bh(&link->link_state_spin_lock);
+	/* Destroy workq of link */
+	cam_req_mgr_workq_destroy(&link->workq);
 
 
 	/* Cleanup request tables and unlink devices */
 	/* Cleanup request tables and unlink devices */
 	__cam_req_mgr_destroy_link_info(link);
 	__cam_req_mgr_destroy_link_info(link);