From 2b36fd66f78fe16a4ea356b28031f97cf66ca506 Mon Sep 17 00:00:00 2001 From: Tharun Kumar Merugu Date: Wed, 15 Mar 2017 14:04:50 +0530 Subject: [PATCH] msm: ADSPRPC: Null check for file session context When any system call is made, before servicing it make sure that the session context is not null and channel info is valid. Change-Id: Ieba53b123d6553c5381db9f0b6d57b8f343e6155 Acked-by: Vishnu Karthik D Signed-off-by: Tharun Kumar Merugu --- drivers/char/adsprpc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 7820f5625266..e0106a7e31fa 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -1435,6 +1435,12 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode, int err = 0; struct timespec invoket; + VERIFY(err, fl->sctx); + if (err) + goto bail; + VERIFY(err, fl->cid >= 0 && fl->cid < NUM_CHANNELS); + if (err) + goto bail; if (fl->profile) getnstimeofday(&invoket); if (!kernel) {