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

Commit 3fc94559 authored by Karthik Anantha Ram's avatar Karthik Anantha Ram
Browse files

msm: camera: 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: If389296dae01b2029fcdfd9db8a2de42460f7d75
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent d1f1dd37
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2929,7 +2929,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;