summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSathish Ambley <sathishambley@codeaurora.org>2017-03-08 10:55:48 -0800
committerSathish Ambley <sathishambley@codeaurora.org>2017-03-08 10:55:48 -0800
commitdf22d814021fbb88ee53f85e013b4fcfceab2f41 (patch)
tree55dc7797f535e3f81af6f9aa622fc1b398eae2ac
parent45ad5727c99fa3e06acd6977de2bddb47ce758d1 (diff)
msm: ADSPRPC: Null check for file session context during release
While releasing the device, check if the file session context is NULL to make sure we are not dereferencing it during file free. Change-Id: I310271189cf710b81c5182b936189fd57ddedd7b Acked-by: Vishnu Karthik <vikarthi@qti.qualcomm.com> Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
-rw-r--r--drivers/char/adsprpc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index 0345e977a2d4..73f0e7449aba 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -2082,6 +2082,10 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
hlist_del_init(&fl->hn);
spin_unlock(&fl->apps->hlock);
+ if (!fl->sctx) {
+ kfree(fl);
+ return 0;
+ }
(void)fastrpc_release_current_dsp_process(fl);
fastrpc_context_list_dtor(fl);
fastrpc_buf_list_free(fl);