Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52aed61a authored by E V Ravi's avatar E V Ravi Committed by Gerrit - the friendly Code Review server
Browse files

msm: ais: reqmgr: Validate num links in link control



This change vaildates num of links passed as part of link
control to avoid invalid memory access.

Change-Id: I13ed4850b2085f188bb319c8f3a09f4faf06f80c
Signed-off-by: default avatarE V Ravi <evenka@codeaurora.org>
parent c5f31717
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2838,7 +2838,8 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)
		goto end;
	}

	if (control->num_links > MAX_LINKS_PER_SESSION) {
	if ((control->num_links <= 0) ||
		(control->num_links > MAX_LINKS_PER_SESSION)) {
		CAM_ERR(CAM_CRM, "Invalid number of links %d",
			control->num_links);
		rc = -EINVAL;