瀏覽代碼

msm: camera: req_mgr: Fixing condition to check num_links range

Current condition to verify that num_links lies in range, is always false.
This change adds fix to condition, while checking num_links range to avoid OOB acccess.

CRs-Fixed: 3830586
Change-Id: I6e69cd373c6d15d2133fc6a286b4dde23234a6b3
Signed-off-by: Yash Upadhyay <[email protected]>
Yash Upadhyay 8 月之前
父節點
當前提交
f747c30cfb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/cam_req_mgr/cam_req_mgr_core.c

+ 1 - 1
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -5228,7 +5228,7 @@ int cam_req_mgr_schedule_request_v2(
 	}
 
 	if (sched_req->sync_mode == CAM_REQ_MGR_SYNC_MODE_SYNC) {
-		if ((sched_req->num_links <= 0) &&
+		if ((sched_req->num_links <= 0) ||
 			(sched_req->num_links > MAXIMUM_LINKS_PER_SESSION)) {
 			CAM_ERR(CAM_CRM, "link:0x%x req:%lld invalid num_links:%d",
 				link->link_hdl, sched_req->req_id, sched_req->num_links);