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

Commit 2ac7f5ac authored by Jishnu Prakash's avatar Jishnu Prakash Committed by Gerrit - the friendly Code Review server
Browse files

msm: sps: Check for pipe_index size taken from client



Add check to ensure pipe index is not greater than
maximum value.

Change-Id: I84918398c9cb5eab7b16a2f9cfd5e986d9d0f288
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent eebad663
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -714,7 +714,8 @@ u32 sps_bam_pipe_alloc(struct sps_bam *dev, u32 pipe_index)
		}
	} else {
		/* Check that client-specified pipe is available */
		if (pipe_index >= dev->props.num_pipes) {
		if (pipe_index >= dev->props.num_pipes ||
				pipe_index >= BAM_MAX_PIPES) {
			SPS_ERR(dev,
				"sps:Invalid pipe %d for allocate on BAM %pa\n",
				pipe_index, BAM_ID(dev));