Procházet zdrojové kódy

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 před 8 měsíci
rodič
revize
f747c30cfb
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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);