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

Commit 2b533456 authored by Vamsi Krishna Gattupalli's avatar Vamsi Krishna Gattupalli
Browse files

msm: adsprpc: Validate the CID



Validating the CID is a valid channel number.

Change-Id: Ic11a259e8a04088f54b3df4bad982e669b02ee71
Acked-by: default avatarAbhishek Singh <abhishes@qti.qualcomm.com>
Signed-off-by: default avatarVamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
parent 367074bf
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1466,8 +1466,11 @@ static int context_alloc(struct fastrpc_file *fl, uint32_t kernel,

	spin_lock(&fl->hlock);
	hlist_add_head(&ctx->hn, &clst->pending);
	cid = (fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)
			? fl->cid : 0;
	if (!(fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)) {
		err = -ECHRNG;
		goto bail;
	}
	cid = fl->cid;
	chan = &me->channel[cid];
	spin_unlock(&fl->hlock);